08-10-2024, 12:08 PM
I tend to be a bit undisciplined with respect to case [Pascal, camel, snake, etc.] in my code. I stick to a convention within a project, but often change that convention between projects.
I use GOSUB in much the same way that Steve does, for minor recurring bits of code within a SUB or FUNCTION. I like it for those situations where I don't want the additional headaches of variable passing or the clutter of DIM SHARED in the main module
I am not adverse to using GOTO when it is warranted, but I do tend to look for ways to avoid it in my code. I like to use it as a debugging/development tool for jumping around blocks that may not yet be fully functional. I don't need the headaches of spaghetti code, but I recognize that it is essentially a major tool of program flow close to the metal so I believe there's no reason to be up tight about it. In general, you won't find it in my code very often.
Given the above, I'm not one to use a lot of labels. If I do, it's usually for DATA block pointers for RESTORE "label" commands. I rarely read DATA without a RESTORE first.
I try to keep my command lines as short as possible and align my following ' comments at a particular tab position. I also typically use some sort of ASCII block comments to separate SUB/FUNCTION blocks. I experiment with various looks quite often.
I use GOSUB in much the same way that Steve does, for minor recurring bits of code within a SUB or FUNCTION. I like it for those situations where I don't want the additional headaches of variable passing or the clutter of DIM SHARED in the main module
I am not adverse to using GOTO when it is warranted, but I do tend to look for ways to avoid it in my code. I like to use it as a debugging/development tool for jumping around blocks that may not yet be fully functional. I don't need the headaches of spaghetti code, but I recognize that it is essentially a major tool of program flow close to the metal so I believe there's no reason to be up tight about it. In general, you won't find it in my code very often.
Given the above, I'm not one to use a lot of labels. If I do, it's usually for DATA block pointers for RESTORE "label" commands. I rarely read DATA without a RESTORE first.
I try to keep my command lines as short as possible and align my following ' comments at a particular tab position. I also typically use some sort of ASCII block comments to separate SUB/FUNCTION blocks. I experiment with various looks quite often.
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
sha_na_na_na_na_na_na_na_na_na: