[Discuss] Functional programming @ UVic (was 'C' string tokenizer
for those who hate strtok)
dbarker at turing.cs.camosun.bc.ca
dbarker at turing.cs.camosun.bc.ca
Mon Jul 3 10:05:03 PDT 2006
Thus spake Adam Parkin (pzelnip at telus.net):
...
> I agree that Pascal is an excellent choice as a first language, and
> that's what it used to be used most for.
Indeed, that was precisely why Wirth designed it in the first place.
Early pascal was a single-pass compiler (hence no backward references)
and had no facility for separate compilation - the entire application
had to be in a single source file.
> Now I think the only reason it
> isn't used anymore for first year is because it isn't really used in
> industry which as I said before is the wrong reason to use/not use a
> particular language.
Abso-bloody-lutely.
When I started at camosun (1991) we were using Modula-2 (another Wirth
language, sort of pascal in UPPER CASE) as our main teaching language.
It had the elegance of pascal and a few vey neat features (separate
definition and implementation files and compil;ers which checked same
for consistency, inter alia) but hardly anyone in N America (or the UK
- Europe was another matter) used it commerically.
So what?
...
> I agree that Perl would be a poor choice (although, it is very
> multi-paradigm: imperative, OO, and functional styles are all
> represented). The problem I have with Python is that it's too different
> from other languages (no statement terminator, the use of whitespace for
> blocking, etc).
Well MIT used to (still do?) use scheme as their teaching
language. I'd argue that's rather further from most
likely-to-be-encountered-in-the-workplace languages than python is.
I believe that as of python 2.something you can use { and } to delimit
blocks.
I don't tell my students this...
> It's also very OO in nature from my experiences with
> it. OTOH, it'd force students to learn good indentation early
> on. =8->
Well the WYSISYG nature of the indentation is IMHO almost reason enough
to use it...15 years teaching experience has shown that if you don't
force students to intent properly, most of them never will.
Example: when we were still using modula-2 we had one instructor whose
marking was done almost entirely on the basis of program layout - I
know of one former student is is still ticked off that a working
assignment was marked lower than somebody else's no-working assignment
because of layout.
So, I munged the emacs pascal-mode uinto a modula-2-mode, which
auto-indented and handed it over to the students. "No need to worry
about losing marks for layout any more!"
How many used it? (A number definitely in single digits)
As for python being too much OO, I'm not sure where you get this
notion from. All the OO stuff is there but you don't have to use
any of it. You can write entire systems which don't use the word
'class' once. (as opposed to the pathetic java insistence on having a
'main' class! Oh really...)
Another thing I greatly like about the language..
--
|Deryk Barker, Computer Science Dept. | Music does not have to be understood|
|Camosun College, Victoria, BC, Canada| It has to be listened to. |
|email: dbarker at camosun.bc.ca | |
|phone: +1 250 370 4452 | Hermann Scherchen. |
More information about the Discuss
mailing list