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

Murray Strome wmstrome at shaw.ca
Sun Jul 2 16:48:26 PDT 2006


stephen hawkes wrote:
> Adam Parkin wrote:
>>> 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.
> 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
>> -- 
>> Adam Parkin
 From my ancient experience, when OO was in its infancy, it was found 
that, in general, people who had first learned functional programming 
(and that includes me) had a much more difficult time learning to become 
really good Object Oriented programmers.  I have taught both types, and 
have to admit that I personally prefer functional programming. Perhaps 
this is because most of my programming was to solve strongly 
mathematically oriented problems, or to do things like cross assemblers, 
emulation of one computer on another, or real time operating systems 
(before LINUX was around to help with that sort of stuff) much of it in 
machine or assembler languages.

Thus, I am not sure that concentrating on OO in first year is 
necessarily a bad thing.  However, I don't know about any studies which 
compare the effectiveness of programmers using functional techniques 
after first learning OO.

Murray


More information about the Discuss mailing list