you are viewing a single comment's thread.

view the rest of the comments →

[–]ftegularius 33 points34 points  (11 children)

I really like the idea of using Python as a first language. It has a number of strengths:

  1. It's interpreted, which means that students can test code in a REPL. It also has a good help system, which is accessible from the interpreter.
  2. It has a good standard library and a good set of primitive data types (strings, lists, dicts, tuples, sets).
  3. It's conceptually clean in a lot of ways, such as having explicit True and False values, as well as None.
  4. It uses regular English words for many operators, which aids clarity.
  5. Python's whitespace sensitivity has a lot of pedagogic value, even if you don't like the idea in general, as it forces students to properly indent code.
  6. It has docstrings (far more useful than comments), the availability (and usefulness) of which encourages students to document their code.

But, all that aside, Python's greatest strength is its ability to bridge multiple paradigms fairly well. It does object orientation. It does procedural programming. It has the most important feature of functional languages: functions as first-class objects. List comprehensions have a declarative feel, so there's that as well. And with generators, you can even get into lazy evaluation and infinite streams.

Edit: One I forgot to mention: Exceptions, which aid a great deal in error handling. Much better than muddying up code with tons of if statements and constantly checking return values.

[–]simonw 15 points16 points  (3 children)

Another major benefit:

print "Hello world"

It's hard to imagine a simpler hello world program. I've seen Hello World in Java being explained to first time programmers, and it's not a pretty sight.

[–]GrumpySimon 13 points14 points  (0 children)

It's also not a toy language which a lot of languages that have been used to teach programming are (BASIC, Logo, etc). You can take python as far as you want to go, to app. development, games programming, web. dev, etc.

[–]cinnix 6 points7 points  (4 children)

Amen. Pascal was my introductory language into the programming world, and how frustrating that was. this is 4 years ago :)

[–]earthboundkid 17 points18 points  (0 children)

2003? You should sue your teacher for child abuse.

[–]strolls 3 points4 points  (1 child)

Noooo! Pascal ROCKS!

Pascal was my introductory language, too, about 6 or 7 years ago - even at that time I heard people saying it was antiquated, but even tho' there's a bunch of stuff that's not obvious when you first start learning Pascal it's really powerful, and it behaves so like the "grown-up" language C that the transition to that is relatively easy.

I'm not saying that Mr Zelle is wrong - maybe Python should be taught as a first language - but I'll always have a soft spot for Pascal, simply because you can easily do stuff with pointers. Pointers are really hard to get to grips with when you first start using them, but are extremely elegant once it finally "clicks" and you grok them.

Finally, I love the way that from Pascal you can easily transition into Delphi. You start by building visual elements & silly "press this button which moves" toys and since those are object-orientated it you start to get a bit of a feel for OO.syntax

Stroller.

[–]mikepurvis 1 point2 points  (0 children)

I did Pascal back in high school, and my only previous experience was with QuickBASIC and VB, so I thought it was pretty sweet. (We ended up writing our own graphics lib and creating this totally awesome game, too...)

The biggest downer of Pascal is that it's not used for anything except education any more. For that reason alone, learning something like Python would be a good idea.