Experiences/guidance on teaching Python as a first programming language

rusi rustompmody at gmail.com
Mon Dec 9 08:54:34 EST 2013


On Monday, December 9, 2013 5:53:41 PM UTC+5:30, Oscar Benjamin wrote:
> 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.

1 Some Background
=================

  Early in my teaching career - 1988 -- I experienced what it means to
  switch from Pascal to Scheme to teach programming. And in 2002 I
  swtiched to using python.  I may talk a bit about this but before
  that…


2 Some Philosophical Context
============================

  Some years ago I read in a book (I think it was called "Heart of
  Philosophy") about the difference between 'ideas' and 'concepts.'
  Ideas are large vague touchy-feely things like freedom, love, justice
  etc; things that matter but poets deal with better than intellectuals.
  Concepts are the basic currency for an academic.  In a typical 1-hour
  class you deal with a few and in a lifetime you deal with thousands;
  in short they are a dime a dozen -- especially if you are an academic.

  And yet if you have a conscience you'd know that covering the concepts
  specified in a formal printed syllabus is cheating.  What really needs
  to be conveyed are a few ideas:
  - modular code
  - code invariants
  - abstractions
  - Syntax, semantics and the large grey in between which for want of a
    better word we may call 'structure'
  - Recursion much wider than people think
    see http://blog.languager.org/2012/05/recursion-pervasive-in-cs.html
  - Interpretation
    see http://blog.languager.org/2013/08/applying-si-on-sicp.html
  - Computable and non-computable
  - The meaning and significance of the word 'code'
  - (Even more vaguely) beautiful (and ugly) code

  Before reading on, I suggest you think what for a while what for you
  are important/core ideas and then what vehicles/mediums are
  conducive/obstructive to them.


3 My Prejudices
===============

  Historically I've been associated with functional programming. While I
  am not so passionate about it as when I was half my age. still I'd
  say:

  - FP *as a philosophy* collects a bunch of stuff -- technology,
    practices, culture -- that conduces to good programming even for
    kids who after the course never use FP *as a technology*
  
    See http://blog.languager.org/2012/10/functional-programming-lost-booty.html

  - By contrast OOP is mostly (at best) clerical common sense --
    organizing libraries to be easily searchable is better by data than
    by code.  At worst OOP is hogwash -- inheritance.

    And so…
  - Python which can be quite functional, imperative and object oriented
    has a rather special place.  Because it is object oriented you will
    be able to use it to silence those who are subscribed to that
    religion.  Because it is imperative you can write straightforward
    code -- 'scripts' -- without undue fanfare Because it is functional
    (well almost -- I have some beefs in this regard) you can use it as
    a vehicle to actually convey important *ideas* in short space and
    time

  - For me Lisp (closely followed by APL) are the ultimate in
    programming paradigms.  However they are not serious technology in
    2013. [Even the birthplace of Scheme -- MIT -- has switched to
    python]. And so in 2013 python occupies a sweet spot in the sense of
    being academically clean and realistically usable.

  - That said there are some important elements of FPLs, most notably a
    polymorphic type discipline, that are sorely missing from python.
    Unfortunately Haskell is much harder to teach/learn than python and
    with each new addition only gets harder.  So python remains even
    with its lacks, an academically sound language.

4 CS-Edu Writings
=================

   My CS-101 syllabus from the early 90s -- 
   uses gofer a predecessor of a predecessor of Haskell
   http://www.the-magus.in/Publications/ip.pdf

   Some more general CS-Edu related writings, containing strewn about
   "FP is a good idea"
   http://blog.languager.org/2011/02/cs-education-is-fat-and-weak-1.html
   and following 2 posts

------
रुसि मोदि
["Rusi Mody" in devanagari so that GG will not use an obsolete charset]



More information about the Python-list mailing list