Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
program crashes about 20% of the time
#13
(12-18-2022, 06:50 PM)mdijkens Wrote: This really looks like it started as Basic, then migrated to qbasic then to qb64...
Done this a few times myself.
Always start refactoring code to remove goto and gosub and localize variables with strong typing. 
It takes some time, but you win that back in the long run....

No need to get rid of "GOTO" and "GOSUB... RETURN" but have to keep track of it carefully. Please don't make QB64(PE) more like Freebasic and Visual Basic for some people.

"ON... GOTO" and "ON... GOSUB" have a way to induce bad habits too. I agree those should be replaced by "SELECT CASE... END SELECT" which is far more readable and easier to control.

A programmer who cannot decide between "GOTO" and "GOSUB" to jump around in code should stop insisting on it. Put the "subroutine" block into a subprogram that could be called by name. Because using "GOSUB" must have a "RETURN" around somewhere. Please remember that in Q(uick)BASIC, and later on in QB64(PE) line numbers are not required, and therefore there is no sense in programming as if the opposite were true. Cannot hate "RETURN without GOSUB" interpreter error message that much as an excuse not to force "subroutines" to be self-contained, or as an excuse to not create subprograms of any kind.

I agree with the strong typing except for people very used to implicit declarations of variables. Again, things have to be examined more carefully because it's left entirely at the programmer's disposal. "OPTION _EXPLICIT" could only do so much, and some coders have a problem with it.
Reply


Messages In This Thread
RE: program crashes about 20% of the time - by mnrvovrfc - 12-18-2022, 07:23 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  question on determining time spent in area fistfullofnails 9 845 08-25-2025, 01:55 PM
Last Post: fistfullofnails
  how to get a file's modified date/time and size in bytes? madscijr 36 7,859 05-10-2025, 05:17 AM
Last Post: eoredson
  Testing against multiple elements at a time without select case CMR 4 845 04-17-2025, 02:16 AM
Last Post: CMR
  Hard time with hardware acceleration. Pete 8 1,040 03-21-2025, 11:29 PM
Last Post: Pete
  Assigning Date$/Time$ does not wotk eoredson 15 2,562 09-13-2024, 05:05 AM
Last Post: eoredson

Forum Jump:


Users browsing this thread: 1 Guest(s)