

Why Python is a great language for teaching introductory programming classes - edw519
http://www.stanford.edu/~pgbovine/python-teaching.htm

======
ComputerGuru
Wow! I had to re-read the second point several times before I could get it
through my head: "Compile-time type errors annoy students to no end. It's
better to at least let their program run and do SOMETHING rather than fail to
compile and do NOTHING."

This is non-sense. It's encouraging bad coding practice, and it's the reason
why languages like ColdFusion, JavaScript, etc. gave real developers so much
trouble: amateurs write code that "runs" but is wholly broken. I agree that
Python is a great beginner (and pro) language, but not for this reason!!

~~~
attack
This may not fit your way of looking at this problem but please, read on.

One of the most fun things about python, or any terse loose language, is that
you can now write amazingly massive amounts of code without having to do
exhaustive checking as you go. For example, in C, a non-expert will often end
up having to write tons of tiny functions, recompiling, and testing
_constantly_ in order to avoid the hell that is having written a large chunk
of code containing one tiny error and not being able to find that error even
after hours of debugging.

Just the other day I reimplemented a rather large network protocol coded in C
into ~1500 lines of python all at once. When it was done I decided, with some
trepidation, to just run the whole thing and see what happens. It worked! Soon
after, my test code did find one small type error in an obscure edge part of
the code, but the good feeling from getting the immediate success didn't go
away!

So the bad practice is not having tests/asserts anyway -- regardless of
whether your language has type checking. He is right that just running as much
as possible can be much more encouraging and even FUN, for beginners
especially.

------
johnm
Wow! It's frightening how little people learn from history. Scheme/Lisp is
much better for that use now and has been for, oh, decades. [But, then again,
that's coming from a guy at that little community college on the peninsula.
:-)]

It's truly sad to me that Berkeley and MIT seem to have dumped Scheme as the
introductory language for the "job skills" approach of using less flexible but
more popular languages.

~~~
aneesh
fwiw, Harvard still teaches Scheme in its introductory sequence.

~~~
jacobolus
Yes, but the Harvard course’s treatment isn’t nearly as deep as MIT’s SICP
course was, skipping most of the coolest parts, and they put it after a C
course.

------
abless
At my university they teach you ML as the first language. It's a pretty cold
start, but I think it's worth it.

------
etal
Good points. One that's not really mentioned is that beginning CS students
often want to start learning a language that will make them employable, right
away. (Or, their parents want them to.) I know professors get a lot of
pressure to teach Java instead of, say, Scheme or ML. Python offers a way out
of that, by leaving room in the language for illustrating different CS
concepts clearly, but also dangling that carrot of employability -- see
<http://news.ycombinator.com/item?id=181676>.

~~~
sah
I think this is one of the best points for Python as a teaching language. It's
not just approachable, it's also practical. I think most of the positive
points mentioned here also apply to Ruby.

~~~
jrockway
Ruby requires you to understand OO to understand the language. While every CS
student eventually needs to understand OO, it's not something I would want to
explain in the first lecture.

For that reason, I agree with the article that Python (or Scheme) is a good
starting language. You can start with nothing, and add concepts until you
understand the whole language. You don't need to know programming before you
can understand "hello world".

(Amusingly, I don't really like Python or Scheme, but I do like Perl and CL.
I'm not sure what that says about my personality, but I'm sure it's something
:)

~~~
sah
What's so mysterious about puts "hello, world"? I think you have a mistaken
impression of Ruby.

~~~
jrockway
You have to explain what "hello, world".puts does.

~~~
sah
It throws a NoMethodError, because strings don't have that method. And you can
introduce that kind of syntax at roughly the same time you'd have to in
Python.

------
tokipin
here's something related: [http://okasaki.blogspot.com/2008/02/in-praise-of-
mandatory-i...](http://okasaki.blogspot.com/2008/02/in-praise-of-mandatory-
indentation-for.html)

(re: indentation-sensitive languages for teaching)

~~~
sah
There's a difference between "mandatory indentation" (good!) and what Python
does. I wrote a rant on this subject:
[http://www.hackerdashery.com/2006/09/close-block-
delimiter-s...](http://www.hackerdashery.com/2006/09/close-block-delimiter-
symbols.html)

~~~
jacobolus
Your rant is rather silly, but if you'd like to know about the colon at the
end of blocks:

[http://mail.python.org/pipermail/python-
list/2000-December/0...](http://mail.python.org/pipermail/python-
list/2000-December/062885.html)

[http://mail.python.org/pipermail/python-
list/2000-December/0...](http://mail.python.org/pipermail/python-
list/2000-December/063055.html)

If you really want a close block delimiter, python is happy to oblige. Just
spell it `#end`. ;-)

------
newt0311
Interesting that many of the reasons listed for beginning programmers could
actually apply to all programmers.

