[TYPES] Followup to "Suggestions for Advanced Programming course?"

Benjamin C. Pierce bcpierce at saul.cis.upenn.edu
Thu May 20 10:16:40 EDT 2004


As promised, here is a summary of the responses I received to my query a
few days ago.  One (to me) slightly surprising pattern that emerges is
that almost everybody teaching such courses seems to roll their own
materials -- are there really no suitable textbooks, despite the *many*
books out there on functional programming and/or software engineering
techniques in various languages?

     - Benjamin

----------------------------------------------------------------------------
[My original message.  Responses follow...]

From: Benjamin Pierce <bcpierce at cis.upenn.edu>

Some of us at Penn are thinking about a new junior-level undergraduate
course on "Advanced Programming."  The goal is to take students who are
already *competent* programmers (having already done a considerable amount
of coding in several courses during the first two or two and a half years)
and give them a sense of how really *good* programmers work.  

Of course, we'd prefer to do this in the context of a civilized programming
language!  In particular, discussing modularity will be much easier in a
language with a modern module system or powerful type-system support for
modular programming -- this makes SML, OCaml, and Haskell natural choices
[*].  However, advanced textbooks and related course materials such as
projects -- critical for the success of such a course -- are not so
plentiful for these languages.

There must be lots of Types readers who have worked on similar course
designs.  Would you be willing to share some of your experiences?

Please reply directly to me and I will summarize to the list.

Regards,

     Benjamin

[*] I know Scheme also has good modularity support these days, so this is
another possibility; I would be interested in hearing about what kind of
advanced coursework people are doing in Scheme.  However, our taste runs to
statically typed languages.

-----------------------------------------------------------------------------
From: "Benjamin C. Pierce" <bcpierce at saul.cis.upenn.edu>

I should have added that we are, of course, also considering Java and C#
as possibilities.  But the students already see a lot of Java (and C) in
their other coursework, so it would be nice to expose them to some of
the programming ideas and habits of thought encouraged by functional
languages (persistent data structures, structural recursion, ...).

Ideally, one would do 3/4 of the course in a functional language and use
the remaining time to show students how they can transfer idioms from
these languages to more commonly used languages such as Java and C#.

    - Benjamin

-----------------------------------------------------------------------------
From: "Greg Meredith" <gregmer at microsoft.com>

It really depends on what you mean by *good*. Is good measured by number of production lines of code in service in actual products? Is good measured by some aesthetic judgment about design? Is good measured by some combination of utility and beauty?
 
In my experience really robust, maintainable code is boring. It's very simple. There is no place for cleverness except as is absolutely required by the problem being solved. It's very easy to read and heavily documented. Finally, and most importantly, it is correct -- clearly, unequivocally and demonstrably so.
 
The best and most advanced programmers i know write code like this -- no matter what language they write in.
 
Best wishes,
 
--greg

-----------------------------------------------------------------------------
From: Matthias Felleisen <matthias at ccs.neu.edu>

I started teaching an advanced programming course several years
ago at Rice and I continued here. I let students choose their
programming language. The good news is that I have always had
Schemers in the course and that they always won. The bad news
is that the rest of the class almost always just shrugs this
off with "they are just better programmers."

Good luck -- Matthias
-----------------------------------------------------------------------------
From: Paul B Levy <P.B.Levy at cs.bham.ac.uk>

Funny you should say this - I just gave a course on "Principles of 
Programming Languages" (not a programming course at all).  3/4 of the 
course was in call-by-push-value, while the other 1/4 related the material 
back to Java, the one language that all students taking the course knew.

Paul

-----------------------------------------------------------------------------
From: "peetm" <peet.morris at comlab.ox.ac.uk>

Could I suggest using a language that is -relatively- commercial - something
like C#/Java/PHP - or, on a declarative note, perhaps XSL?

The only content 'tip' I'd like to give is to include stuff on exception
handling - not just the mechanics, but also something on
philosophy/psychology (but related).  

A long time ago, I knocked up a paper on exception handling which was VB
specific (attached).  It does contain some material that you might find
useful or at least interesting - hope it's useful in some way.

peetm
-----------------------------------------------------------------------------

I've given this a lot of thought (but don't have a lot of practical
experience, so take my opinions with a giant grain of salt.)  First,
I believe that SML is a dead-end.  The libraries for doing interesting
things just aren't there.  That would limit it to Ocaml or Haskell.

I actually believe that Haskell might be better because the way
of thinking is so radically different.  For instance, working
with parser combinators, FRAN or XML-ish ideas or other
interesting domains is going to be a little easier in Haskell (if
only for the type-class support).  I also think you'll get more
"gee whiz" reaction out of the students.

That's what I would do, anyway...

-Greg
-----------------------------------------------------------------------------
From: Andrew Myers <andru at cs.cornell.edu>
        
We have such a course at Cornell; the course number is CS 312
(http://www.cs.cornell.edu/courses/cs312) and I have taught it for the last
three years. The official title is "Data Structures and Functional
Programming," though it also includes a fair amount of operational semantics
and a healthy dose of "software engineering in the small" topics such as
specifications, modularity, and reasoning about code (both correctness and run
time). There is no textbook for the course, just lecture notes that have
evolved over the years. The course is taught using SML/NJ, which Greg Morrisett
started when he taught the course before me. SML is a great language for
teaching these ideas.

Best,

-- Andrew

-----------------------------------------------------------------------------
From: Michael Hicks <mwh at cs.umd.edu>

We teach an "advanced programming" course here at UMD, which uses Java
exclusively.  For your money, the most relevant thing we look at is
design patterns and refactoring.  We spend about 3 weeks on the standard
OO patterns (Proxy, Bridge, Visitor, etc.) and 1 week on refactoring,
which invariably employs these patterns.  We also look at patterns in
threaded programs.  Java 1.5's new util.concurrent library is really
excellent, we essentially go over many of the patterns that it
implements, including means for signalling, scheduling, using
asynchronous (one-way) messages, etc.  For this we also spend 2-3
weeks.  All of these patterns tend to come up in big open-source code
that I've come across.

As for course materials, Lea's Concurrent Programming in Java is useful
for the threaded stuff, and we use the Gang of Four book and the
Refactoring book as source material for the other stuff.  There is not,
unfortunately, a book that gets all of this, so the students are stuck
with our course notes.  We have used Liskov's Program Development in
Java, but students tend not to like it (though I think it's great).

See http://www.cs.umd.edu/class/spring2004/cmsc433 for the current
version of this class (being taught by Jeff Foster).

Hope this helps,
Mike

-----------------------------------------------------------------------------
From: "Jacques Carette" <carette at mcmaster.ca>

Coming from 10 years of recent industrial perspective, there is one aspect
of what makes a truly 'good' programmer that you have not covered: being
able to cope and make solid changes in a large system that they have not
written and are catapulted in to.  Thus a project that involves making
incremental changes to an existing SML, OCaml and/or Haskell program would
teach them a lot more realistic skills than any 'from scratch' project you
can assign.

In fact, I fired people who insisted on rewriting a lot of code (when they
had weak reasons to do so), and promoted those who could understand the
existing design and integrate extensions into that design properly.

>From that point of view, it is not difficult to come up with projects to
extend existing medium sized programs with new features, or even to refactor
parts of it to allow for new features.  I can be explicit if you wish.

For projects 'from scratch', what I have done for a recent course was to
assign 2 projects (an untyped interpreter, and then a typed interpreter
implementation for a small lambda calculus), but completely implemented 4
times: once each in C, Java, Ocaml and a choice of Prolog or Mercury.  The
majority of the students came back to me and said that they are 'sold' and
will now use Ocaml for their own programming.  A number of these students
were C++ and/or Java devotees going in to the course.

Jacques
-----------------------------------------------------------------------------
From: "Jonathan S. Ostroff" <jonathan at yorku.ca>

How about Eiffel using Design by Contract (preconditions, postconditions,
class invariants, loop variants and invariants). The agent mechanism allows
for quantification in the assertions. You also have genericity, multiple
inheritance, covariance, and a simple design notation BON. Various texts are
available. There  is a free version of a commercial compiler that supports
persistence, GUIs, network programming and a .NET plugin, as well as an open
source compiler. We use it in a required third year Software Design course. 

Jonathan

-----------------------------------------------------------------------------
From: "Daniel C. Wang" <danwang at CS.Princeton.EDU>

quite an interesting resource...

http://web.access.net.au/felixadv/files/output/book/

-----------------------------------------------------------------------------
From: Alan Schmitt <alan.schmitt at polytechnique.org>

You probably know that Didier Rémy gave a course at Polytechnique on 
Modular Programming (with modules and objects). If not, here is the 
course page (in French): http://pauillac.inria.fr/~remy/poly/mot/

Best,

Alan

-----------------------------------------------------------------------------
From: Alwyn Goodloe <agoodloe at gradient.cis.upenn.edu>

   This is a great idea. A lot of stuff gets covered in 120-121 and this
course could help fill gaps. Personally I feel that we stress things like
big-O a little too much at a time when most of the students have no idea
how to write larger programs. So maybe more stress on abstraction. The
languages that you mentioned really do provide the developer with richer
abstraction mechanisms. Barbra Liskov's book has some great stuff for
Java. Paulson's book also has some good stuff for SML. Personally I would
also like to see a course on Software Specification and Design taught as
well. Something that would mix informal diagrams with something more
formal to teach students how to design large programs.

  Well thats my two cents.

AEG

-----------------------------------------------------------------------------
From: "Robert Harper" <Robert.Harper at cs.cmu.edu>

I've been meaning to invent just such a course here at CMU.  I was thinking
of calling it "Programming Methodology", or maybe "Real Software
Engineering".  What I want to do is to teach what it means to write good
code, and how to do it.  Students just do not know.  My idea is to be
integrative, putting together the various ideas they get in various classes
(good algorithms, typed language, modular design, specification and
verification, and so on).

Let me know what you come up with!

Bob 

-----------------------------------------------------------------------------
From: "David Espinosa" <david at davidespinosa.net>

I guess we have to ask what a *good* programmer is.  I'm all for
well-structured code, but, in my experience, especially in industry, what
makes a *productive* programmer is more like:

  - experience with many common APIs, especially
    those related to networking and distributed programming
  - experience with many tools, especially yacc and make
  - ability to work with large, badly written programs
    written by other people
  - ability to download and reuse code and libraries from the net
    (see the previous point!)
  - an emphasis on testing, especially automated testing

I'd also look into the Extreme Programming movement.  And I'd try to find
other materials written by programmers active in open-source software.

That said, yes, I think the ML module system is one of the most important
advances in programming since the high-level language.  Of course, MacQueen
didn't invent it, since it's based on the Lawvere's thesis and the earlier
work of the logicians.  But he did apply it to a real programming language,
which is a pretty big step.

David

-----------------------------------------------------------------------------
From: Dirk Draheim <draheim at acm.org>

would you like to have a look at EASE ? EASE is a reusable software
engineering process designed for practical courses in higher education. It
is ultra-lightweight and combines new concepts with proven concepts from
software management and didactics. EASE targets the learning of soft-skills
and high-level hard skills. EASE neither is nor favors a concrete modeling
or implementation paradigm.  It is non-prescriptive from the outset.

http://www.inf.fu-berlin.de/projects/ease/process/

resp.

http://www.inf.fu-berlin.de/projects/ease/

resp.

- Dirk Draheim. Learning Software Engineering with EASE. In (Tom J. van
Weert and Robert K. Munro, Editors): Informatics and the Digital
Society. Kluwer Academic Publishers, January 2003.

It would be great, if you have questions and/or comments. It would be great,
if you try EASE in your project.

Yours

Dirk

http://www.inf.fu-berlin.de/inst/ag-pr/draheim/
-----------------------------------------------------------------------------




More information about the Types-list mailing list