Hacker News new | ask | show | jobs
by Retardo_88 2024 days ago
"For beginners, BASIC is great and Python is terrible." I am curious about this. Do you mind elaborating?
3 comments

Consider the the classic koan:

  10 PRINT "Retardo_88"
  20 GOTO 10
To fully grok this, the concepts you need are: the idea that you can instruct a computer to do things, the notion of source code as a list of such instructions which will normally be executed one at a time, in order, and - crucially - that the instructions can reference other instructions and that this is the fundamental leap that makes computers interesting. In other words, Turing Machines 101. It's a perfect demonstration.

Now consider the simplest equivalent program in Python:

  while(true):
      print("Retardo_88")
In addition to all of the insights mentioned above, you need the concept of higher order control flow statements, the concept of nested execution, the concept of boolean literals, the concept of a function call... there are so many questions that are hard to answer. Why do I need parentheses? Why do I need the colon? What's the deal with the indent? What gives with the weird grammar of "while true"? Etc...

It gets worse the moment you want to do anything nontrivial and have to wrestle with objects, methods, and dot-syntax. BASIC sends the message that computers are simple, easy to grok things that follow simple, logical rules; Python sends the message that they are a bottomless well of dizzying complexity.

I would argue that a more measured alternative to your conclusion is “people should learn computers from the bottom up”, starting with direct exposure to a program counter and ending with high abstraction. I’m not sure this is the best way to learn, but I think it would be a lot better than what we teach now.

A great intro CS curriculum could be some RISC assembly -> C -> Lua -> Haskell -> Agda, maybe also branching off into lisp and prolog.

If you wanted to get really extreme, you could even tack on “Discrete transistors -> logic ICs -> FPGA ->”

As a perpetual beginner, I feel BASIC is under-rated. We should use BASIC to start children off with computing. They'll learn the hairy stuff in due time, but the key is to get them hooked early; and BASIC does an awesome job of that.
What was your first language? Mine was Basic.

Pascal was the first language I was taught in.

I still have not (after 40 years) learnt Python... Hang on, when did Python start....That long

"Modern" BASICs/Pascal are also otherwise decent languages that suffer from a reputation of newbies writing bad code with them.