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

Adam Parkin pzelnip at telus.net
Sun Jul 2 18:25:30 PDT 2006


stephen hawkes wrote:
> 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.

Ditto for me (too easy).  It is however a very good course for non-CSC 
students to take simply because it's not in-depth on any topic and gives 
just a little flavour of so much of comp sci.

> 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.

Yeah that's true, and I have another example for you: in my labs the 
other day I had my students write a piece of code for which a do-while 
loop was ideal (it presented a menu, and looped until the user picked 
quit).  Half of the class still used an infinite do loop with a break 
statement inside of it (or just repeated some code before the while 
loop) instead of doing the do-while because "profs in 110/115 said that 
it's bad to use do-while".  WTF?!?

> 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++?

I agree that Pascal is an excellent choice as a first language, and 
that's what it used to be used most for.  Now I think the only reason it 
isn't used anymore for first year is because it isn't really used in 
industry which as I said before is the wrong reason to use/not use a 
particular language.

As for C++, when I started my CSC degree at college the courses where 
all C++ and at that time SFU was still C++ for first year courses.  I 
don't know what they use now.  I think C++ is a better choice than Java 
for first year (not so heavily OO focused), but it has many of the 
drawbacks of C (manual memory management, etc) in addition to the fact 
that so many people just think the language sucks. =;->

I suppose one big plus that Java has that few other languages do is that 
you can very quickly get to the point where you write applications with 
graphical elements in it.  When I was tutoring a student in 110 a couple 
semesters back his second assignment involved drawing a chess board with 
a double for loop using the Graphics class and it's methods (drawRect et 
al).  But I'd rather develop good programming habits than the ability to 
draw pretty pictures, as if you understand OO programming you can pick 
up Swing and AWT pretty fast (I know because I had to when I did 405).

> 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.

I agree that Perl would be a poor choice (although, it is very 
multi-paradigm: imperative, OO, and functional styles are all 
represented).  The problem I have with Python is that it's too different 
from other languages (no statement terminator, the use of whitespace for 
blocking, etc).  It's also very OO in nature from my experiences with 
it.  OTOH, it'd force students to learn good indentation early on. =8->

> I do agree, but in my experience more people have problems with it. I 
> found writing ASM helped immensely on understanding pointers.

Absolutely, and I think that's a big part of 230, to really drill into 
students heads how memory is organized and how pointers play out in that 
picture.  Same with SENG 265 and learning C in it.

> 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).

LOL.  I think I was in his 3rd time around as instructor.  Awesome job 
in that course, and as a result of it I think I'm one of the very few 
students at Uvic who actually likes him as an instructor (he can be more 
than a tad rude with students sometimes though).

> 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.

Oh god I could only imagine writing the assignments in Java.  I had a 
friend who started off doing them in C (!!!) and then switched to Matlab 
about halfway through.  That was one of those courses though where I 
really felt as though I learned absolutely nothing in the course 
(combination of poor instructor, poor assignments, and just no personal 
interest).

> 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).

I don't see why not, but I'm not in charge of curriculum. =;->  I agree 
that I'd love to see a "functional programming" course of some kind in 
addition to the just of chunk of 330 devoted to it.

> 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).

LOL, in writing this message my fiance has asked me three times who I'm 
writing because I'm taking so long to write the message that she figures 
it must be more than one message. =8-p
-- 
Adam Parkin
E-mail: pzelnip at telus.net
--------------------------
Anthony's Law of Force:
	Don't force it; get a larger hammer.


More information about the Discuss mailing list