Hacker News new | ask | show | jobs
by teamonkey 910 days ago
“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.“

I genuinely feel that Dijkstra’s famous rant about BASIC had a big hand in killing it off. I don’t think it was the intention but it created so much bias against BASIC. If you created something in basic, or even suggested using it, someone would post that quote in the usenet thread. Like Godwin’s Law.

It’s a shame, because it was so accessible, not just because it was right there but also because it does make it very easy for beginners to understand programming in a way that structured programming doesn’t.

If there’s one language guilty of causing brain damage it’s surely JavaScript.

10 comments

> "I genuinely feel that Dijkstra’s famous rant about BASIC had a big hand in killing it off. I don’t think it was the intention but it created so much bias against BASIC."

Seems doubtful? In the essay where his famous comment on BASIC appeared ("How Do We Tell Truths That Might Hurt?" https://www.cs.utexas.edu/users/EWD/ewd04xx/EWD498.PDF), Dijkstra took a snarky swipe at many of the major languages of the time: PL/I, COBOL, FORTRAN, APL and COBOL and FORTRAN at least are still around. It was just what in modern parlance would be called a shitpost (no, really, read it), albeit more articulate than most.

(I joke that Real Programmers™ get their shitposts immortalized in ACM publications: https://dl.acm.org/doi/10.1145/947923.947924 )

I’m not sure Dijkstras quote had that much of an effect. Visual Basic was one of the most popular languages until Microsoft killed it.

Basic evolved to have blocks, scopes, procedures, and functions. Visual Basic is probably closer to Algol or Pascal than to the original GOTO-only BASIC which Dijkstra was complainig about. VB.Net has the same semantics as C# which means it is one of the most powerful languages available. But it is not really a good beginner language anymore.

Dijkstra wrote that in 1975 [1]. I don't think it had a major hand in killing off BASIC considering that "peak" BASIC occurred later with the home computer market. The vast majority of home computer users had no clue who Dijkstra was as they happily typed BASIC listings from various magazines and books.

[1] https://www.cs.utexas.edu/users/EWD/transcriptions/EWD04xx/E... - 18th June 1975

For me the biggest motivation to not dip my toes too much into BASIC on 8-bit computers was the abysmal performance. If I remember right, assembler was about 100x faster, compiled high-level languages like PASCAL about 10x faster, and FORTH somewhere inbetween compiled languages and assembler.
FORTH could've been a very elegant alternative to BASIC on 8-bit class hardware, but one major problem with it was that having to enter absolutely everything as RPN/postfix notation could be very unintuitive at times. E.g. prefix or mixfix notation for some things such as math is only very slightly harder to parse, but then provides a big gain in user friendliness. And floating point math takes up a big chunk of the code in typical BASIC ROMs, so it was clearly regarded as important to duplicate that desk calculator-like UX.
Look up the Jupiter Ace from 1982. A lot like a Timex-Sinclair, but with Forth as the built in language.

https://en.wikipedia.org/wiki/Jupiter_Ace

Perhaps forth for newbies wouldn't be too friendly... but you can totally write an infix parser in forth, and toggle in and out of that parser.
At least on the C64, I use BASIC as largely a scripting language and master scheduler, calling 6502 machine language subroutines with SYS, and reserving BASIC for the very highest level main loop or non-speed-sensitive tasks that would be inconvenient, bulky or unnecessary to write in assembly. It gives me a scaffold to hang things off.
So, basically how people use python now?
Learning quickbasic which was compiled in DOS as a kid pushed me to learn x86 assembly just to make pixels appear on screen faster. Its slowness was a feature for me in the end.
>impossible to teach good programming to students that have had a prior exposure to BASIC

As someone whose first exposure to computer programming was BASIC on an Apple II in the early 1980s when I was around 8-9 years old and who later went on to learn multiple other programming languages, I always wondered what about BASIC inspired that particular sentiment. Was it the line numbers? The GOTO statement? The use of "GOSUB.....RETURN" rather than explicit functions?

I tried to answer it in the article that someone recently posted to HN as well - https://news.ycombinator.com/item?id=38743062

spoilers: There was no GOSUB in the version Dijkstra commented on. There was not even anything else to put in an "THEN" statement than a line number ("THEN 210" is the code). If you wanted to store user's name in your variable, "n" was the name to go with, because "name" was not supported. And so on... :)

Oh, and the line numbers were a necessity.

Interesting, I wasn't aware how much the language had evolved from the mid 1970s through the early 1980s.

However, this line in your article would seem to indicate that GOSUB was available in the original version:

>The first version of the language was extremely limited, compared to any later popular version of BASIC. The only supported keywords apart from math functions were: LET, PRINT, END, FOR...NEXT, GOTO, GOSUB...RETURN, IF...THEN, DEF, READ, DATA, DIM, and REM.

It was probably the lack of structure like blocks and scopes. Everything is flat and global and GOTO means control can enter and exit at any point.
"Teamonkey's law" sounds good to me. Whenever BASIC is mentioned, someone will invoke Dijkstra's rant.

>If there’s one language guilty of causing brain damage it’s surely JavaScript.

I'm not sure about that. The only language that I felt led to bad things from developers was perl, mainly because it was so difficult to read later.

> mainly because it was so difficult to read later

But it wasn't, it was just so easy to write badly early.

> If there’s one language guilty of causing brain damage it’s surely JavaScript.

In its detractors, you mean? (This was a perfectly reasonable comment until you got irrational at the end; even people who understand Dijkstra's comment but feel that we lost something should be extremely pleased that the thing that took BASIC's place is a language that supports structured programming and is otherwise as nice as JS.)

> If there’s one language guilty of causing brain damage it’s surely JavaScript

Hahaha. I largely consider JavaScript to be the new BASIC - not because you can learn how to do some fun or useful things with it in an afternoon, but because it is ubiquitous. Web browsers are everywhere, and nearly all of them have JavaScript. A lot of JavaScript's quirkiness and inconvenience seems to derive from its web browser/DOM environment. (It's probably still easier to write GUI apps in Visual BASIC.)

Also: I'm still disappointed that Python 3 removed the print statement, so that

    print "hello, world!"
is no longer a program that works both in BASIC and in Python.
> If there’s one language guilty of causing brain damage it’s surely JavaScript.

Why JS and not PHP?

PHP stops you from being clever with it by making you angry at times. It's very predictable too, on its hardly avoidable, disgusting pitfalls.

But things may still change for the worse with that process of Scala-ification they are doing to PHP 8.x.

both, depending on adhesive tape usage
they are both guilty
related: https://news.ycombinator.com/item?id=38743062 - starts with this quote and checks whether it even applied to the BASIC we talk about here. Points out at least a few of the advantages of the integrated BASIC environment.

It also never killed it off, and it wasn't a big rant - just a single sentence - either. He also ranted over a few other languages in the same list.

PHP, like JS, sees a lot of unstructured code relying on random global variables in the wild as well :)