Experiences/guidance on teaching Python as a first programming language

Oscar Benjamin oscar.j.benjamin at gmail.com
Mon Dec 9 07:23:41 EST 2013


Hi all,

I work in a University Engineering faculty teaching, among other
things, programming. In our last meeting about improving our teaching
syllabus and delivery we've identified the first year programming
courses as an area where there is room for improvement and we're
considering (mainly on my suggestion) switching to using Python as the
first programming language that we use to introduce our students to
programming. I'm interested to know if anyone can share experience of
a similar situation or can point to any case studies about this.

The course is for ~100 1st year students with half studying
Engineering Mathematics and the other half Electrical Engineering.
Currently we introduce programming with C for the 1st semester and
then C++ for the 2nd semester. In the 3rd semester they learn Matlab
and following on from that they can take optional units run by the CS
department in Java, Haskell and many more. Our faculty does not
currently offer any Python courses for students at any level in CS or
Engineering.

Many of the students complain that the C course is too hard and my
experience is that it doesn't equip them with the general
understanding of programming that we really want them to get from the
first programming course. I'm not sure about the Electrical
Engineering students but the Engineering Mathematics students tend not
to use C/C++ once they have covered Matlab and just use Matlab for all
future projects, including in situations where it is highly
inappropriate.

In our recent meeting I proposed that Python should be the first
programming language, and others proposed that Java should be the
second. So we're currently evaluating the option of having Python in
the first semester followed by Java in the second. Both courses would
have to be created from scratch meaning that we would need to draw a
complete outline and syllabus by mid-January in order to roll this out
for the next academic year.

I think that the benefits of this would be that using an "easy"
language would be less distracting while we introduce the general
concepts of programming. What we really want is for the students to
focus on things like "why would I write a program?", "what kind of
things can I do with a program?" and "how would I go about writing a
program that does X?". Ideally by the end of the course we want that,
given a description of a simple command line program that would
perhaps calculate something or do some simple data processing, then
the students would feel confident that they could do that. I think
that using C distracts them from learning these more important general
lessons as they struggle with simple things like how to print output,
or avoid segmentation faults. Also ideally they would continue to use
the language, where appropriate, for subsequent project work (which is
when they would *really* learn the language).

Some of the objections to the idea that were voiced in the meeting were that:
1) Some people felt that Python is not an "industry standard" unlike
C/C++/Java and that it is not as good for employability.
2) Students should learn to program in a statically typed language
because it leads to good programming discipline.
3) Python is too close to Matlab (which is considered essential for
some industries our students often go in to).
4) It is better for students to be introduced to programming with a
low-level language so that they gain a better understanding of how
computers "really work".
5) Learning to program "should be painful" and we should expect the
students to complain about it (someone actually said that!) but the
pain makes them better programmers in the end.

I'm particularly interested to know if anyone can share experience of
switching to teaching Python as a first programming language in a
similar context. A written up case study that I could circulate among
the relevant staff would be especially useful.


Thanks in advance,
Oscar



More information about the Python-list mailing list