3 ms·
I 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
by cameldrv 3y ago
I 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.