[Discuss] Functional programming @ UVic (was 'C' string tokenizer
for those who hate strtok)
Adam Parkin
pzelnip at telus.net
Sun Jul 2 13:50:17 PDT 2006
stephen hawkes wrote:
> 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
Hmm, that's interesting that 212 is being revamped, I actually applied
to teach that one in the fall. =8-> I agree though that for CSC
students the course really isn't useful because it really has no focus,
but rather a "lets touch on everything just a little bit" feel to it.
> 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
I think one of the real problems is that in using Java so many students
are encouraged not to question what something does ("what does that
public static void part in front of main do?", etc), but to just do it
because "it works" which is a horrible habit to get into *ESPECIALLY*
when you're just learning. I'm not so sure that teaching OO along with
programming proper isn't a bad idea, but I do agree that the way things
are done now there's a tendancy for students to confuse OO concepts
(inheritance, etc) with general programming concepts (modularity,
writing functions, etc).
> 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
Depending on who you get, that is the way it works. 110 is general
intro to programming (just happens to use Java), and in 115 they go
headlong into inheritance, abstract classes, etc. The problem is that
Java forces you to think so much in terms of objects and classes that
you can't completely divorce the OO stuff from the procedural/imperative
stuff.
> 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
Absolutely, but there is one big downside to squeak (at least the way I
understand it) -- it's difficult to transfer something you've written on
one machine to another.
> 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.
Who cares if people are using it or not, so long as it teaches students
the skills they need to learn to write code in any language. =8->
That's why I have such a problem with Java as a 1st language, because I
think most of the reason institutions choose it is because it's widely
used and not because it's a language that lends itself to teaching
programming concepts.
> 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
Well, in functional programming proper generally there is no iteration,
so you are *forced* to use recursion to solve most problems. But yeah,
I agree, recursion should be introduced sooner.
I've never really understood why recursion is such a big deal, I found
things like pointers and references much harder to understand than
recursion.
> 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).
Totally, I had him for that course as well, and remember Wookie quite
fondly. =8-> Our first assignment we had to write factorial as a
recursive function in 6811 ASM and yeah, it was a great learning experience.
> 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
I had to use ML & Scheme in 330, and Scheme in 212, but yeah that was it
for the "forced to use". The only other time I was even encouraged to
use a functional language was the AI course with George (and that's just
because he's a big functional programming guy). Some people (like Taras
mentioned previously) write their 340 assignments in ML, but when I did
that course I was forced to use Matlab for everything.
> 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"?
Actually, George once mentioned to me the idea of having an "advanced
functional programming" course which IMHO could very easily turn into
the best course offered at UVic. The only problem is that there is so
little exposure to functional programming in the first 3 years of a CSC
degree that most students wouldn't be able to meet the pre-reqs. =;->
> Anyhow I think I've ranted enough.
Oh come on, this is the VLUG forum, there's no such thing as ranting
enough (or too much for that matter). =;->
--
Adam Parkin
E-mail: pzelnip at telus.net
---------------------------
More information about the Discuss
mailing list