TITLE: Programming Languages and the Right Level of Forgiveness
AUTHOR: Eugene Wallingford
DATE: June 06, 2014 4:24 PM
In the last session of my May term course on agile software
development, discussion eventually turned to tools and
programming languages. We talked about whether some
languages are more suited to agile development than others,
and whether some languages are better tools for a given
developer team at a given time. Students being students,
we also discussed the courses used in CS courses, including
the intro course.
Having recently thought some about
choosing the right languages for early CS instruction,
I was interested to hear what students thought. Haskell and
Scala came up; they are the current pet languages of students
in the course. So did Python, Java, and Ada, which are
languages our students have seen in their first-year courses.
I was the old guy in the room, so I mentioned Pascal, which
I still consider a good standard for comparing CS1 languages,
and classic Basic, which so many programmers of my generation
and earlier learned as their first exposure to the magic of
making computers do our bidding.
Somewhere in the conversation, an interesting idea came up
regarding the first language that people learn: good first
languages provide the right amount of forgiveness when
programmers make mistakes.
A language that is too forgiving will allow the learner to
be sloppy and fall into bad habits.
A language that is not forgiving enough can leave students
dispirited under a barrage of not good enough, a barrage of
type errors and syntax gotchas.
What we mean by 'forgiving' is hard to define. For this
and other reasons, not everyone agrees with this claim.
Even when people agree in principle with this idea, they
often have a hard time agreeing on where to draw the line
between too forgiving and not forgiving enough. As with so
many design decisions, the correct answer is likely a local
maximum that balances the forces at play among the teachers,
students, and desired applications involved.
I found Basic to be just right. It gave me freedom to play,
to quickly make interesting programs run, and to learn from
programs that didn't do what I expected. For many people's
taste, though Basic is too forgiving and leads to diseased
minds. (Hey to Edsger Dijkstra.) Maybe I was fortunate to
learn how to use GOSUBs early and well.
Haskell seems like a language that would be too unforgiving
for most learners. Then again, neither my students nor I
have experience with it as a first-year language, so maybe
we are wrong. We could imagine ways in which learning it
first would lead to useful habits of thought about types
and problem decomposition. We are aware of schools that use
Haskell in CS1; perhaps they have made it work for them.
Still, it feels a little too judgmental...
In the end, you can't overlook context and the value of
good tools. Maybe these things shift the line of "just
right" forgiveness for different audiences. In any case,
finding the right level seems to be a useful consideration
in choosing a language.
I suspect this is true when choosing languages to work in