Comment by icedchai
11 hours ago
I haven't written BASIC since I was a teenager! The more "modern" basics, without line numbers, were a definite improvement. I went from AppleSoft to AmigaBasic and QuickBasic.
11 hours ago
I haven't written BASIC since I was a teenager! The more "modern" basics, without line numbers, were a definite improvement. I went from AppleSoft to AmigaBasic and QuickBasic.
I had a little crisis at 12 when I went from BASIC to Pascal: how was that supposed to work without line numbers? The statements were just floating around without structure!
I spent two years on hn just to read this comment. So true!
After all these decades, I finally learned that I wasn't the only one who struggled with line numbers from BASIC to Pascal. Thanks, buddy!
Even with line numbers it's a hell of a lot easier once you get out of the 24 line X 80 character console window and into an editor you can scroll without needing the LIST command.
I only use BASIC with line numbers, mostly GW-BASIC and pcbasic. Without numbers it just feels like Lua or python or any other scripting language, but worse? The line numbers BASICs come with their own almost-REPL (IDE?) that I find quite nice (or at least fun) to work in. Maybe mostly nostalgia, but it is the only reason for me to use BASIC at all. I have some basic-mode installed to edit BASIC code in emacs, but I only rarely edit the code outside of its natural built-in line-editor.
> The more "modern" basics, without line numbers, were a definite improvement.
Never used them, and yet I can unquestioningly agree. The way you had to number each line in increments of 10 so that you could insert a line 15 later in between lines 10 and 20 was, looking back at it, insane.
I can understand why they did it. In the era of no full-screen text editors, where you just typed each line one at a time into a REPL (not that I knew the term REPL at the time), and it stored the lines in the order of their lines numbers... well, that was the only way to edit your code. Made a mistake on line 20? Type a brand-new line 20 and it will replace the old line 20. Want to insert a line between lines 10 and 20? Type in line 15 and it will go and insert. So you could actually load your program, edit your code at the REPL, and save it.
But man, using an actual visual editor is so, so, SO much better than that system. I'm glad it's on the dust heap of programming history where it belongs. It was a decent option for the time when computers had 4K of RAM, but once it was actually possible to edit code in a full-screen editor, line numbers were no longer useful.
A lot of 8 bit basics had a RENUM which would even out the line numbers and repoint all the GOTO statements.
The line numbers were also used for GOTO and GOSUB (although later on languages supported strings instead of numbers).
Yeah, forgot to mention that, but that's entirely correct. Modern BASIC variants (I assume) let you label lines so that GOTO and GOSUB can still be used. But with a few flow-control constructs (I don't know modern Basic but in the linked repo I saw a couple `while ... wend` blocks) the need for GOTO is much reduced, I'm sure. GOSUB, well, again I haven't checked. But if GOSUB is allowed to point to a string label rather than a line number then it just becomes a function call, and is still a useful construct. (GOTO only has utility in being able to do the equivalent of `break` or `continue` inside a loop).