Live data from Hacker News

The Origins of Python

inference-review.com

31–40 of 73 posts

Re: The Origins of Python

#32
post #31

What are other good options for intro programming languages if not python?

C, JavaScript, any other general purpose language as long as you have a good teacher. I think the importance of which language you pick first is really overrated.

Re: The Origins of Python

#33
post #28

Earlier quoted context omitted.

>>> 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…

I'm not sure I understand what's missing in python compared with BASIC. 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 What am I missing? (besides the misguided social expectation that you need to teach the fancy generator stuff to…

That's a good question. What I'm thinking of (revealing my age) is something more like:

    10 LET I = 1
    20 PRINT I
    30 LET I = I + 1
    40 IF I 
And because BASIC really is that primitive, you can talk about what each line of code is doing, without too much fiction. The mental virtual machine is not radically different from the real machine.

The teacher would draw the variables as boxes with numbers in them, and update the numbers in the boxes with the eraser and chalk (further revealing my age).

In contrast, Python starts with everything is an object, with properties and methods...

But I agree about the fancy generator stuff. I think you can teach Python in the same fashion by limiting yourself to a few basic (sic) features, and adopt the same virtual machine fiction while remembering that it's a few more layers of abstraction away from reality.

Re: The Origins of Python

#34
post #28

Earlier quoted context omitted.

I'm not sure I understand what's missing in python compared with BASIC. 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 What am I missing? (besides the misguided social expectation that you need to teach the fancy generator stuff to…

That's a good question. What I'm thinking of (revealing my age) is something more like: 10 LET I = 1 20 PRINT I 30 LET I = I + 1 40 IF I And because BASIC really is that primitive, you can talk about what each line of code is doing, without too much fiction. The mental virtual machine is not radically different from the real machine. The teacher would draw the variables as boxes with numbers in them, and update the n…

Properties do change things because they change the data representation, but i.print() is really no more complex than print(i).

Re: The Origins of Python

#35
A Python beginner spent 5 years to learn Python.

That's what my friend's experience when he tried to switch to programming years ago.

A beginner with Javascript spent 6 months to make backend API, desktop , mobile, web applications with SQL in no time.

The reason i think lies in something more deeply cultural: He think Python is the only thing he should know, nothing else is needed.

Re: The Origins of Python

#37
post #28

Earlier quoted context omitted.

I'm not sure I understand what's missing in python compared with BASIC. 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 What am I missing? (besides the misguided social expectation that you need to teach the fancy generator stuff to…

That's a good question. What I'm thinking of (revealing my age) is something more like: 10 LET I = 1 20 PRINT I 30 LET I = I + 1 40 IF I And because BASIC really is that primitive, you can talk about what each line of code is doing, without too much fiction. The mental virtual machine is not radically different from the real machine. The teacher would draw the variables as boxes with numbers in them, and update the n…

  40 IF I 
Do mean "GOTO 20"? Because if you don't that line either makes no sense or has a "magic" implicit goto that has to be explained. Assuming you meant that as a loop then the equivalent in Python is hardly difficult to understand:

  i = 1
  print(i)
  while i 
Same number of lines of code, `while` has a clearer meaning than the magic of your goto-less line, and is still somewhat clearer (more comprehensible control flow) than the goto version of that line. The only missing thing is the explicit line labels, but that can become a presentation format when discussing the code. Every editor you'd start a student with can show line numbers (and many show line numbers by default).

You don't have to start with "everything is an object", but you will get there quickly. Teaching procedural programming centered on numbers and strings and basic control flow in Python is not a challenge for a competent teacher. And then the language can grow with the learner as they gain understanding of computing and programming.

Re: The Origins of Python

#38

A Python beginner spent 5 years to learn Python. That's what my friend's experience when he tried to switch to programming years ago. A beginner with Javascript spent 6 months to make backend API, desktop , mobile, web applications with SQL in no time. The reason i think lies in something more deeply cultural: He think Python is the only thing he should know, nothing else is needed.

Those sound like two very different individuals, or like they chose very different sets of learning materials/teachers. The difference between Python and JS for that is almost nonexistent except that it can't be used (directly, or at least not easily) as the frontend for a web application (in the browser).

> The reason i think lies in something more deeply cultural: He think Python is the only thing he should know, nothing else is needed.

That's the problem, then. And it's also not part of Python "culture", it's his problem (but not just his, others fall into the same trap). I've had plenty of colleagues who swear by C, C++, Javascript, and are incompetent or barely competent in any others. He made a mistake, which is unfortunate. He would have benefited from a mentor (or a better mentor if he had one). Real programmers understand that languages mostly don't matter except with regards to the libraries they have access to or the platforms they run on.

Re: The Origins of Python

#39

A Python beginner spent 5 years to learn Python. That's what my friend's experience when he tried to switch to programming years ago. A beginner with Javascript spent 6 months to make backend API, desktop , mobile, web applications with SQL in no time. The reason i think lies in something more deeply cultural: He think Python is the only thing he should know, nothing else is needed.

Those sound like two very different individuals, or like they chose very different sets of learning materials/teachers. The difference between Python and JS for that is almost nonexistent except that it can't be used (directly, or at least not easily) as the frontend for a web application (in the browser). > The reason i think lies in something more deeply cultural: He think Python is the only thing he should know, n…

That made me think for a long time. Because when i choose a language to teach newscomers/students, it's really important for me to not make them fall into the trap due to the culture. Newscomers is different from experienced programmers who know language is just a tool.

Re: The Origins of Python

#40
post #32
post #31

What are other good options for intro programming languages if not python?

C, JavaScript, any other general purpose language as long as you have a good teacher. I think the importance of which language you pick first is really overrated.

I disagree, pick an interpreted language that doesn’t need compilers or other complicated setup. Python, javascript, something where there’s little friction to getting started, and which has a REPL. Pick a language that a friend or colleague can help you with, this is probably an even bigger advantage, if possible.
Post reply on HN