Experiences/guidance on teaching Python as a first programming language

Oscar Benjamin oscar.j.benjamin at gmail.com
Tue Dec 17 12:12:07 CET 2013


On 17 December 2013 00:39, rusi <rustompmody at gmail.com> wrote:
> On Tuesday, December 17, 2013 5:58:12 AM UTC+5:30, Ned Batchelder wrote:
>> On 12/16/13 3:32 PM, Wolfgang Keller wrote:
>> >>> And ever after that experience, I avoided all languages that were
>> >>> even remotely similar to C, such as C++, Java, C#, Javascript, PHP
>> >>> etc.

Thanks for sharing your experiences Wolfgang. I think many of my
students have a similar experience after learning C and it is
interesting to hear it from your perspective many years later.

I was also taught C as an undergrad but having already learned Java, C
and C++ before arriving at University I found the C course very easy
so my own experience is not representative. Many of the other students
at that time found the course too hard and just cheated on all the
assignments (I remember one students offering to fix/finish anyone's
assignment in exchange for a bottle of cider!).

>> >> I think that's disappointing, for two reasons. Firstly, C syntax isn't
>> >> that terrible.
>>
>> > It's not just the abysmally appalling, hideously horrifying syntax. At
>> > about everything about C is just *not* "made for human beings" imho.
>
>> I've never heard C syntax reviled quite so intensely.  What syntax do
>> you like, out of curiosity?
>
> I had a paper some years ago on why C is a horrible language *to teach with*
> http://www.the-magus.in/Publications/chor.pdf

Thanks for this Rusi, I just read it and it describes very well what I
think about our own C course. My choice quote from the beginning would
be "When the irrelevant becomes significant, the essentials become
obscured and incomprehensible."

(BTW is there any reason that the document is repeated twice in the same pdf?)

As a case in point one of my tutees asked for help with his C
assignment last week. I looked at his code and it was a complete mess.
I explained roughly what it should look like and he explained that he
had had so much trouble figuring out how to get the compiler to pass a
pair of strings into a function that he had given up and used global
variables instead. He's just not ready yet to get an intuitive
understanding of where to put the asterisks in order to make it work -
and as you point out in that paper the rules for where the asterisks
go are hopelessly inconsistent.

A couple of weeks before, another of my tutees brought their
assignment which was about dynamic memory allocation (~7 weeks into
her first programming course). She had just written something like
   char *x = (char*)malloc(31*sizeof(char));
for a global x at the top of the file. So the message about dynamic
memory allocation was entirely lost in the details of C: "dynamic
memory allocation means using malloc".

These types of problems are compounded by the fact that the current C
course uses automated marking so a program that produces the correct
output gets full marks even if it is terribly written and the student
entirely misses the point - another thing about this course that
definitely needs to change.

> I believe people did not get then (and still dont) that bad for
> - beginner education (CS101)
> - intermediate -- compilers, OS, DBMS etc
> - professional software engineering
>
> are all almost completely unrelated

Agreed.


Oscar



More information about the Python-list mailing list