2 ms·
“The beauty of BASIC is that everything is so concrete. Every line has a number, and you just keep going down the page unless you hit a GOTO. It's easy to reaso
by velcrovan 3y ago
“The beauty of BASIC is that everything is so concrete. Every line has a number, and you just keep going down the page unless you hit a GOTO. It's easy to reason about what's going on inside the computer. Abstractions make a language powerful, but also harder to learn.”
I will try to say this without bitterness: a wistful statement like this could only come from someone who hasn’t had to maintain production software of any size written in BASIC, which was my situation from 2016–2021. It was incredibly fragile and difficult to reason about, *because of* its so-called simplicity, global variables and line numbers with GOTO/GOSUB in particular.
Abstractions do not always make a language harder to learn. A language with the right set of abstractions for the problem space is going to be easier than a “simpler” language that is insufficient to meet the size or complexity of the actual problem. Machine code is the most concrete of all: by your standards it ought to be the most beautiful language of all.
The appropriate problem space for BASIC is “an alternative to assembler for teaching programming to middle-schoolers” — which was how I first encountered it. Using it even for that use case is irresponsible in an age where we have Python and Pyret.
- cameldrv 3y agoI certainly wouldn't advocate writing production software in BASIC, but I'm not sure Python is better than BASIC as a first language. Suppose you're trying to do maybe the second program someone ever writes -- print out the numbers from 1 to 10. In BASIC it's something like: 10 LET X=1 20 PRINT X 30 IF X <= 10 GOTO 20 In Python it's: for x in range(1,11) print(x) In the BASIC example, you need to understand LET, PRINT, IF, and GOTO, and the general concept of a variable. In the Python example you have to explain: 1. What a variable is 2. What a for loop is, how it's repeatedly assigning values from a sequence to the variable x and then running the indented code 3. That range(1,11) is a function call (what is a function?) 4. That this function returns a generator (now we're really in the weeds) 5. That print(x) prints out the variable. IMO Python 2 was a better teaching language because lists are concrete and generators are (much) more abstract.
- robinhouston 3y agoI don’t want to make a big deal of a small oversight, but I think it _is_ telling that you omitted to increment X in the BASIC version. That’s a category of error that’s impossible to commit in the Python paradigm you’re comparing it with.
- cameldrv 3y agolol good catch! Obviously Python is a better programming language for normal work, but I'd still maintain BASIC is easier to get started with. The old 80s microcomputers were absolutely ideal for this, and the other magical thing was that you'd just boot up and start typing. You could use BASIC to write software that wasn't quite as good as what you'd buy, but it was in the ballpark, which was very exciting for a kid learning to program. Roblox I think is the modern version of this.