@neauoire right most one feels best imo, having line numbers not be aligned feels wrong to me, but i still want indentation
@neauoire I never did. But I would have wished for an empty line after GOTO, GOSUB, RETURN, perhaps.
@neauoire historically the first, but the third seems nicest
I never had the screen space or memory for something like that.
@neauoire I am not aware of any version of BASIC where the middle one is even possible because every BASIC I am aware of strips leading whitespace on all line numbers or labels, so the right one if the platform allows otherwise the left one
@neauoire Both types of indentation look weird to me. But thatβs probably mostly to do with me learning BASIC on a 22 column display. :)
@neauoire i'm with the classic left on this. was the same with my old fortran as well. for some reason, explicit line number and indentation don't really mix on my mind.
edit: maybe because they both achieve the same, to my cognition? scope denotation...
@neauoire The BASIC I used didn't require line numbers, rather used labels for gosub etc... so that wasn't an issue!
If I had to choose I'd definitely go with the rightmost though.
I wrote a Ruby script to indent and otherwise tidy BASIC code for my contributions to https://github.com/coding-horror/basic-computer-games .
@neauoire With a tab consisting of three spaces.
@neauoire I wrote code like the first one when I learned basic (there was no other choice...) nowadays I would pick the one on the right as I think it's easier to scan the line numbers if they are in one column.
@neauoire
Only BASIC I do is on a Tandy with 40 column lines. No room to waste on indenting. π
@neauoire a lot of the basic code I looked at often tried to use the little screen estate they had as efficient as possible. No indentation and, if the dialect allowed, several commands per line. But if that is not an issue, I really like the third variant. The positional number acts as index and reading can be quickened when they line up. Meanwhile indenting the logics helps building up a mental mode
@neauoire first option always and forever. Second option is pretty cursed IMO
@neauoire I do the 1st (and you have no choice in Atari BASIC, my usual dialect, or my own TinyBasicWeb, which tokenize on input & regenerate listings), but TurboBasicXL and GFA BASIC automatically do 3rd, which is very readable.
But you kind of don't need/want indentation in BASIC. Each logical segment might be separated by REM, but should "tunnel thru rock" to reach a goal, not have a lot of branches. You can use a flowchart to show program flow at a larger level.
#basic #retrocomputing
@neauoire legacy code always looks like 1, modern code usually looks like 3
Never insert unneeded whitespace when using 300 baud.
@neauoire That's neat. I would definitely go for the third style in a modern BASIC. However, I doubt that I've programmed in BASIC since the C64. ISTR that you *could* use extra whitespace but I often didn't because it took up extra memory. Also pretty sure that I often used extra space to make DATA statements more readable, such as for sprite/font data.
@neauoire with GOTO going anywhere, which lines should be indented ? How to group logically related lines by indentation level if you can go to any line in a block ?
@lfourrier I indent backward jumps only, which land in the same scope.
https://wiki.xxiivv.com/site/basic
@neauoire @lfourrier how would you indent the fizz buzz sample from two days ago ?
@neauoire @lfourrier I was thinking of this one

@lfourrier 2 to 7
@neauoire @lfourrier ok, quite logical.
On 10 to 14, I think it could be interesting to have some marker on lines that are targets of goto
@lfourrier yeah, I went back on the fizzbuzz design. I think that program wasn't a great design, and the trickiness of indentation is maybe a side-effect, compared to a nicer cleaner design:
https://paste.sr.ht/~rabbits/f5934649c079ade94094b87ad31c4c1bf0ff6d05
@neauoire @lfourrier much more usual design for modern developers
@neauoire
I write BASIC as style 1 but I have a prettyprinter that turns it into style 3