Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

  40 IF I <= 10 THEN 20
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 <= 10:
    i = i + 1
  print("DONE")
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.



Indeed the GOTO was implicit. Putting other things after THEN came later, as did the while loop.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: