| >>> Python is a good learning language precisely because it hides those details. This allows people to the learn the basics like variables, loops, strings, etc without getting overwhelmed with too much at once. I wonder if whether this is a blessing or a curse depends on the person who is learning it. For instance, my first language was BASIC in 1981, and so my gut reaction to discussions about learning languages is that BASIC lets you at least imagine the workings of the machine that's running your program. The teacher can draw boxes on the blackboard to explain 10 LET X = X + 1 And we weren't far from the machine. There were not very many turtles on the way down to the level of logic gates. I also learned how a microprocessor worked, reading books as a high school kid, and articles in Byte Magazine, something that would be laughable for today's big CPU's. That's a bottom-up approach. For others, a top-down approach might be better, e.g., seeing mathematical equations develop, in beautiful notation, without caring what the machine is doing under the hood. Another comment in this thread mentions the ability to read code. Python has sprawled. I've been coding in Python for 10 years (as a "scientific" programmer) and recently took a Python skills quiz. I mentor beginners. Yet I scored barely at the top of "average." I can't read the code that's in a lot of the more elaborate Python packages. A problem is motivating people to learn a learning language when they know that they'll outgrow it. |
Sure, you can teach students to write `print(" ".join(str(x) for x in range(1, 11)))` to print numbers from 1 to 10... but you don't have to do that. In fact, `X = X + 1` works just fine. The old school BASIC style like `X = 1; while X <= 10: print(X); X = X + 1` still works in python. (sorry for the lack of indentation)
What am I missing? (besides the misguided social expectation that you need to teach the fancy generator stuff to a total beginner...)