Hacker News new | ask | show | jobs
by mceachen 334 days ago
Are you remembering the same BASIC that I’m remembering? With fixed line numbers? Refactoring was near impossible. Spaghetti code was par for the course. You were forced to build everything twice or thrice if you wanted a final product that wasn’t embarrassing.

Just not having line numbers cooked in is a total game changer.

And no GOTO.

4 comments

I had a C16, and later a C128D (and therefore a C64). The C64 had the most limited BASIC of them all, with v2.0. So many advanced features were hidden behind PEEK/POKE. With BASIC 3.5 on the C16, they added the RENUMBER command, which made refactoring much easier, and it had a SOUND command, despite having a much simpler DSP implementation. The C128 had BASIC v7.0, which included a sprite editor, and much more advanced SOUND command.

If they upgraded the C64's BASIC to 7.0, that would already make a lot of things much more accessible.

> With fixed line numbers? Refactoring was near impossible. Spaghetti code was par for the course.

Yup, even for the old 8-bit computers FORTH would've been a lot more elegant than BASIC. But back in the day BASIC came with highly valued conveniences such as a soft-float implementation that meant support for the "desk calculator" use case was available out of the box, and users could just go on from there.

There are many flavours of BASIC; some with line numbers and GOTO/GOSUB, some without line numbers and real subroutines. FreeBASIC for example doesn't have line numbers. It's similar to Fortran or COBOL, both of whom also started out with line numbers and GOTO-oriented programming. But no one uses those languages like that any more.

No idea what this BASIC looks like though; the documentation seems chaotic and hard to access. Just saying that BASIC does not necessarily mean the BASIC that you or I used back in the day. I also agree that you can do a hell of a lot better than Python to introduce programming to kids.

I mean it's a better language for middle-school kids. They shouldn't be concerned with refactoring.

Important thing about BASIC is that each "command" does a rather limited amount of "stuff". In that way it is kinda similar to assembly language.

Plenty of elementary and middle-school kids learned LOGO which is a vastly more elegant language than BASIC. (It's essentially a LISP with different syntax, the one thing that's inadvisable about it for modern purposes is its use of dynamic scope.)
I think understand of programming as a sequence of commands is necessary before you go to abstractions. BASIC's GOTO is a feature, not a bug: that's how assembly work.

As an adult I'd strongly prefer Lisp over Basic. But I appreciate Lisp or lambda calculus elegance after I spent some time with more basic kind of stuff. Going to higher abstractions right away won't have the same effect