Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] More or bignums/ints
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: John Hughes <jfh@c...>
Subject: RE: [Caml-list] More or bignums/ints

Brian Hurt asked "How well does teaching ML in a first course work?"

To tell the truth, we teach Scheme for about 7 weeks, then 4.5 weeks
of 
ML, and then, in Spring, teach Java. Both Scheme and ML are taught 
purely-functionally: there's no "set!" in our world. The idea is to
teach them
  
* to think algorithmically
* to be able to analyze the big-O performance of their programs
* to know some basic structures like lists and trees, and even BSTs

For that, pure-functional is just fine. ML's structures and functors
give them a nice transition point towards OO programming: they start
to 
gather data and operations together, and they learn some data hiding
with
opaque signatures. By the time they reach Java, they're sophisticated
enough to complain appropriately: "You mean I can't just pass a
function
as an argument to another function? Why do I have to write a stupid
wrapper
around the Java container classes to get a safe CarList or a
TruckList? Why
isn't there appropriate polymorphism?" [OK, maybe they don't remember
that
it's called polymorphism, but they know that they want it...]

How well does it work? Well, the next year they end up in the same
courses 
as their friends who took a "program in Java" course first, and a
"data
structures and algorithms" course second. The average scores for the
two groups in the big software-engineering course are pretty much 
indistinguishable. Not surprisingly, the ones in OUR course do better
in the programming languages course in general. And lots of our
success
stories are with students who have never touched a computer before,
except
for email and Microsoft Word, so I think we're doing OK. 

Thanks again, to everyone here, for the suggestions on getting "safe"
integers into OCaml. I'm more or less committed to doing what was
suggested and redefining all the standard operations in some CS17.ml
"library" that's preloaded for them (after I show them the dark
underbelly of OCaml in which integer operations are silently 
incorrect <as operations on integers, I mean>). 

--John Hughes

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners