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.

There were some advantages. The more advanced BASICs gave you functions / subroutines so you didn't have to mess around with using global variables to pass arguments to a "gosub".

> 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).

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".

Beginners' All-Purpose Symbolic Instruction Code, if I remember correctly.

I also started programming in BASIC, and moved on to Pascal when I discovered Turbo Pascal around 1983, which also happened to be the language most of my CS classes used a year later when I switched majors from foundering in EE to excelling in CS.

I still have a bunch of my BASIC programs from the day.

    10 PRINT "THIS IS FINE"
    20 GOTO 10

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

In context though, it was trying to move standards forward.

Look at how acceptable C has changed over the years.

In ye old days it was acceptable to just read in any old text without checking bounds, now that is considered harmful.

There are still use cases for hairier parts of C, but that doesn't mean they should be used all the time. Same with goto.

[dead]