[Discuss] Functional programming @ UVic (was 'C' string tokenizer
for those who hate strtok)
stephen hawkes
sghawkes at shaw.ca
Sun Jul 2 17:46:19 PDT 2006
Adam Parkin wrote:
> 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.
Well it won't be changed for a while (from what I've heard, I didn't
actually go to any of the meetings myself, but another cscu exec member
did). When I took it I really didn't learn much in my opinion, but it
was an interesting overview.. too easy when I took it though.
>
>> 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).
That's what I meant by flailing, just doing stuff because it makes it
compile and not knowing why you are doing it. While I do think teaching
OO is good, I also think it is so much for some people to wrap their
brains around at one time that it leads to the "flailing". I think some
teachers also teach "rules" that are wrong, like elementary school
teachers with the "you can't start a sentence with because". I can't
really remember any solid examples, best I can think of is "don't use
global variables". Globals should be used judiciously, but it's not like
you shouldn't use them at all.
>
>> 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.
So why not pascal or something for a first language? C is no good
because of the memory management stuff (bit to much for that course
imho), but if you were to argue that it isn't too much then C++ would be
a good candidate, as you could start with procedural/imperative then
using the same language move to OO. Don't most other universities use c++?
As much as I love perl, I really think it would make a horrible first
language (imagine the mess students would make with that). How about
python though? I think I remember Corless stating that he thought it was
a good language for teaching.
>
>> 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.
I never thought of that. But in all honesty I have written no smalltalk.
It's interpretted though, so you just need the text files.
>
>> 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 do agree it's not great to choose a language to teach with by what is
used in industry, but it does make what you are learning more applicable.
>
>> 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.
I do agree, but in my experience more people have problems with it. I
found writing ASM helped immensely on understanding pointers.
>
>> 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.
Sounds familiar, maybe we were in the same course. I was in the second
230 class he taught (the first one gained him the nickname inflexible
bastard from some student that was doing poorly).
>
>> 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.
340 I was allowed to use anything (had to be matlab for the first
assignment though). I chose octave, as I had experience with matlab
already and it was super quick to write the solutions in (line for line
with the pseudo code). I saw some java one friend wrote.. it was a lot
longer. I don't think anyone used a functional language.
>
>> 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. =;->
Yeah I would like to take a course like that, but I'd probably be over
my head. Isn't there a growing population of students in CSc, could an
intro fucntional programming course be taught? Either a 2nd or 3rd year
course (there aren't really many second year courses).
>
>> 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). =;->
Haha, fair enough. I usually use that line for when my gf is asking when
I will be off the computer (she's the one that thinks i've ranted enough).
>
> --
> 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