Comment by rmunn
12 hours ago
In BASIC? Why? Why would you do that to yourself?
Don't get me wrong, if he enjoys writing code in BASIC, I'm not going to tell him to stop having fun. It would be silly to tell some random stranger "You're having fun wrong!" (Even if I totally think he's having fun wrong. Grin). If he's having fun with it, go for it.
But man, I looked at the code and got flashbacks. The bad kind. BASIC was the first language I learned when I was a kid, and it's what taught me programming (because after typing "LOAD WIZARD.BAS", I could type "LIST" instead of typing "RUN" and I could actually see what the program was doing. So I learned by reading other people's code. And The Wizard's Castle was pretty good for a BASIC program: it had subroutines, a multi-dimensional map stored in a single-dimensional array (and an actual function defined to convert X,Y,Z coordinates to an index in the array!), and so on. So I am grateful to BASIC for teaching me programming.
And I never, never, NEVER want to write another line of BASIC code again in my life.
But if he enjoys doing so, good for him. I'll just sit here muttering under my breath "But he's still having fun wrong"... :-)
> And I never, never, NEVER want to write another line of BASIC code again in my life.
Awww. I downloaded the ECMA-55 standard from 1978 about a year ago and wrote an interpreter in C to be compliant with its "Minimal BASIC". I then had fun typing in code from old computer magazines. So much nostalgic fun.
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).
1 reply →
Laughing agreement. I’m very sentimental for BASIC.
By the standard of getting kids started it’s an amazing and wildly successful language.
By any other standard, it is absolutely terrible! It commits every famous programming sin! Stay away! Do not learn from this language! LOL
Classic Basic (line numbers, GOTO) resembles 1960s/1970s FORTRAN before it adopted structured programming. The idea when BASIC was invented in Dartmouth in the 1960s that it would be a good introduction to programming for students who might have to learn FORTRAN. The thing is, when BASIC was at its most popular (1980s home computers) FORTRAN itself had moved on from "spaghetti code".
I heard Basic is pretty good as far as embedded script interpreter
"It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration." -- Edsger Dijkstra
even smart people say dumb things sometimes.
like "goto considered harmful" when all assembly language depends on it
1 reply →
[dead]