Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
option explicit
#16
I don't typically use it when doing little one off algorithms, but I've been warming up to OPTION _EXPLICIT more and more when writing big projects, where I really don't want to be dealing with typo errors in dozens of subroutines that are recycling local variables. It mostly catches when I do screw ups like using x and x% interchangeably. In fact, it's just about the first thing I will type in when starting a new large project. It's a lot easier to do it up front, and accept that discipline, than to add it later.

If I were to use any big variable names like SuperCalifragiVariable%, then I'd use it there as well. Those are the bugs that will drive you mad for hours without that tool.

I also find it helpful when I'm going back to clean up and optimize my algorithms. When I see a whole raft of DIMs at the head of a SUB or FUNCTION I start looking for ways to cut the number down while achieving the same results.
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
Reply


Messages In This Thread
option explicit - by Unseen Machine - 01-23-2026, 02:55 AM
RE: option explicit - by SMcNeill - 01-23-2026, 03:11 AM
RE: option explicit - by Unseen Machine - 01-23-2026, 03:24 AM
RE: option explicit - by ahenry3068 - 01-23-2026, 03:29 AM
RE: option explicit - by SMcNeill - 01-23-2026, 04:26 AM
RE: option explicit - by madscijr - 01-23-2026, 03:38 AM
RE: option explicit - by Unseen Machine - 01-23-2026, 04:39 AM
RE: option explicit - by SMcNeill - 01-23-2026, 05:54 AM
RE: option explicit - by Unseen Machine - 01-23-2026, 05:58 AM
RE: option explicit - by Pete - 01-23-2026, 06:27 AM
RE: option explicit - by bplus - 01-23-2026, 07:37 AM
RE: option explicit - by luke - 01-23-2026, 08:18 AM
RE: option explicit - by Magdha - 01-23-2026, 11:59 AM
RE: option explicit - by ahenry3068 - 01-23-2026, 02:43 PM
RE: option explicit - by grymmjack - 01-23-2026, 03:56 PM
RE: option explicit - by OldMoses - 01-23-2026, 04:13 PM
RE: option explicit - by madscijr - 01-23-2026, 06:19 PM
RE: option explicit - by dano - 01-25-2026, 12:40 PM
RE: option explicit - by madscijr - 01-25-2026, 07:32 PM
RE: option explicit - by Unseen Machine - 01-26-2026, 12:02 AM
RE: option explicit - by bplus - 01-26-2026, 03:09 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  An option to not need _GL sub Unseen Machine 4 1,063 10-17-2025, 02:41 PM
Last Post: Unseen Machine
  Found a BUG with the QB64 editor compiled with the -O3 option Coolman 2 834 06-02-2022, 06:27 PM
Last Post: Coolman
  A preview of a new QB64 option SMcNeill 12 2,694 05-04-2022, 01:11 PM
Last Post: DSMan195276

Forum Jump:


Users browsing this thread: 2 Guest(s)