[Edu-sig] Python, Pointers, and lots of Languages...
Peter H. Froehlich
pfroehli@ics.uci.edu
Fri, 23 Aug 2002 14:05:26 -0700
Hi!
I am not convinced that Python is all students should learn, but
probably for slightly different reasons than mentioned here before.
Being exposed to various levels of programming is important, and I
would even include assembly for some platform at the lowest level.
Helps students appreciate what's going on inside, and makes my job
easier when I teach compilers. :-)
Having a working knowledge of C is also important. Whether you like
it or not, you will probably have to at least read C code in one or
the other form for the rest of your life, so you better know how to.
Python would be my current language of choice for "prototyping"
things, and also for "executable pseudo code" during lectures. It
does, however, have one serious drawback in my book: No static type
checking. Back in my compiler course, I had to explain a lot of
"weird asserts" in my sample code...
I believe that students should be exposed to a language with a
strict type discipline as well, probably something like Java,
Eiffel, or Oberon-2. I'd prefer the latter, just for size reasons,
although with Eiffel you could cover more ground (e.g. generics,
contracts).
Finally, giving students an understanding of modern functional
programming through either ML or Haskell seems desirable as well.
The whole type inference business provides a nice trade-off between
what you have to declare and what the language will help you with
anyway.
Ideally, I believe students should run into these languages as part
of "normal classes", not just in the upper division "Programming
Languages" course. That course should be for the really weird
stuff, and for comparisons and emphasis on concepts.
Having said all that, let me get back to the pointer thing: I think
students should be made aware of the fact that "pointers" are a
different beast in different languages. Addresses in assembler,
mostly addresses in C, not at all addresses in the rest of the
languages I listed. Wirth's old "variables whose values are
(anonymous) variables" explanation of pointers is much more
appropriate at those levels (yes, no variables in Haskell but what
the heck), with addresses being one possible implementation for the
necessary indirection.
Whew, what a rant. Sorry for wasting some bandwidth... :-)
Peter
--
Peter H. Froehlich []->[!]<-[] http://nil.ics.uci.edu/~phf/
OpenPGP: D465 CBDD D9D2 0D77 C5AF 353E C86C 2AD9 A6E2 309E