[Discuss] Functional programming @ UVic (was 'C' string tokenizer for those who hate strtok)

stephen hawkes sghawkes at shaw.ca
Sat Jul 1 11:59:15 PDT 2006


Adam Parkin wrote:
> taras wrote:
>> No actually George's class coincided with me delving in the wonderful
>> world of OCaml. I learned it in CSC340 and laughed when all of my ocaml
>> algorithms were 10-20x shorter than people's C/Java versions.
>
> Sorry my mistake, I always assumed it was George's drilling of ML into 
> us in 330 that got you started. =8->
>
>> Most academics these days are stuck on OO. Only the smart ones are into
>> functional programming :) That's why they don't teach functional
>> programming in first year in crappier universities.
>
> Wasn't it UBC that used to have first years learn Lisp before joining 
> the trend and going to Java like everywhere else?  I can understand 
> leaving Lisp behind ((after all) ((the bracketing) sucks)), but I 
> really don't understand the academic obsession with Java that seems so 
> prevalent right now.
>
> Often in conversations I have with profs/grad students @ UVic it seems 
> like I'm one of the few who thinks that first years should be exposed 
> to functional programming.  Not that I think they should go full on 
> into closures, higher-order functions, currying and the like, but I 
> definitely think there should be exposure to more than just one 
> paradigm in first year.  OTOH, people who have taught 110/115 usually 
> look at me when I say something like that and go "but learning Java is 
> tough enough to fit into two terms, how do you expect them to learn a 
> functional language as well?"  And I kind of see this point, but it 
> seems criminal to not be exposed to anything other than OO and 
> imperative languages until 3rd year, and even then usually only in one 
> class (330).
I've heard the same argument, which imho is a weak one. 110/115 are 
being revamped right now, still no plans for introducing functional 
programming. 212 will be revamped soon too, it desperately needs more 
focus. I am not against java for first year, but teaching programming in 
general along with trying to teach object oriented ideas seems a little 
awkward to me. Students get confused, they don't actually understand the 
OO part and they start "flailing" (as one friend put it). I personally 
think teaching a procedural language in 110 makes more sense. Teach 
modularity, scope etc, clean programming in general, then introduce OO 
in 115 carrying on with the clean readable programming extended to OO 
and how OO can help with that. And as long as you are going to teach OO, 
why not force students to write some smalltalk? It's fully OO, squeak is 
easy to install, it's historically interesting and it is still relevant 
(lots of implementations, and you can even write it for palmOS which I 
found interesting). Ok, you could argue against the still relevant as 
I'm sure very few people use it, but it is usable and some people are 
using it.

I also think that recursion has to be introduced early, it's a difficult 
concept for most to grasp at first and introducing it early helps. 
Recursion is a lot easier to read in a functional language (in my 
experience) but it can be taught in any language (that supports it). In 
230 Jason Corless made us solve and assignment question recursively in 
6811 ASM, which was pretty cool since you can see what the stack is 
doing (at that point we were using simulators not the board).

In my experience as well I only was "forced" to use a functional 
language in 330(programming languages) and for me it was scheme. 
Depending on who you take the AI course with (if you take it) you may 
use a functional language. I can't think of any other courses that use 
functional languages. I agree that it is wrong that there isn't more of 
a focus on functional languages, yet at the same time I have no 
solution. Where could they be included? Should there be a course "Intro 
to functional programming"?

Anyhow I think I've ranted enough.
Stephen
>
>> For examples of software in ocaml see the Hump
>> http://caml.inria.fr/cgi-bin/hump.cgi
>
> Sweet, will check that out.....
> -- 
> Adam Parkin
> E-mail: pzelnip at telus.net
> --------------------------
> _______________________________________________
> Discuss mailing list
> Discuss at vlug.org
> http://ladybug.vlug.org/cgi-bin/mailman/listinfo/discuss
>



More information about the Discuss mailing list