Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Program line
#11
Hi
I often make mistakes on coding, the more are the typo mistakes so when I fall in trouble the first thing is Option _Explicit (I know that there is also Option _ExplicitArray but I never used it maybe my code is always short or too simple for lose myself into an array jungle.).
As Bplus and Pete said, the best for me is following some basic rules of good practice to avoid the errors.
1 CamelCase and/or Underscore tecnique to verify that I don't fail to write the right name of the variable
2 self descriptive name of variable, array, label, sub and functions (only in the shortest snippet I use variable names with 1 or 2 characters)
3 so many REMs and 's  to comment what happens in that block of code (few rows at max) and what I expected as output 
4 convert to functions as many blocks of code is possible without increasing the unreadibility of code
5 using PRINT to observe values of variables during the flow of running the application
6 initialization of variable before to use them or to use again them if I need a specific situation/value at the start
7 running the code and verifying that the output is what has been expected

I sometimes used Debug in Qbasic, but I am (and was) no expert of this task. I must say that Debug in QB64pe is strong and very similar to that of QBasic. And also in this one I am not expert but when I have learnt what to do for my debug goals it has been useful.

IMHO Debug has different levels of complexity and it can solve different types of issues about logical and typos errors. But it asks different kind of tutorial and practice to make the user effective with its use.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Default Command Line Experience in Windows is Now Windows Terminal hanness 21 4,397 10-23-2022, 10:15 PM
Last Post: bert22306
  Cool Line Input feature bert22306 2 822 09-13-2022, 05:11 AM
Last Post: JRace
  Anybody use decimals for line numbers? Pete 6 1,108 08-05-2022, 03:28 AM
Last Post: bplus

Forum Jump:


Users browsing this thread: 1 Guest(s)