logoalt Hacker News

linguaetoday at 3:43 PM4 repliesview on HN

I wonder if there are still undergraduate CS programs that use a functional programming language in the intro course? MIT switched away from SICP (Scheme) to Python back in the late 2000s, and Berkeley switched away from Scheme sometime afterwards. Shriram Krishnamurthi has heavily promoted Racket in education and continues to do so, but for introductory CS he has moved on to Pyret, which has Algol-like syntax as opposed to S-expressions and doesn’t require programmers to think in terms of functional programming; for example, Pyret has loops and mutable variables.

At my institution (Ohlone College in Fremont, California), we teach the intro courses in C++. However, for discrete math, a sophomore-level course, each instructor is allowed to choose the language. I chose Haskell the last time I taught the class, and I plan to use Haskell again, since I believe it’s a great vehicle for coding discrete math, plus I believe it’s a great thing teaching undergraduates functional programming early on.


Replies

bunderbundertoday at 4:35 PM

I don’t necessarily feel the need to ban loops and variables, but I do kind of wish schools didn’t start with object-oriented languages. My undergraduate program started with Scheme but I actually think a proper procedural language would be a fine choice too.

(Or even - and I know this is a spicy take - assembly language. An intro-level course that takes students through games like TIS-100 and Human Resource Machine might have a lot of pedagogical value.)

What I’ve observed is that people who have had to spend some time working in a language that maintains a clean separation between functions and data tend to be better at domain modeling, which ultimately enables the to produce designs that are simpler and easier to maintain. OOP can be a powerful mechanism, but it seems like, perhaps ironically, people who only know OOP tend to have a harder time reasoning about information flow, control flow and state. Perhaps because object-oriented language features are mostly meant as a way to abstract over those concerns. Which does have some value, but maybe also discourages learners from thinking about them too deeply.

show 1 reply
ecshafertoday at 4:16 PM

Your discrete mathematics class has programming and is taught by the CS department? I can't say I have seen that. My Discrete mathematics class was taught in the Math department, no programming, and we had a few CS theory courses in the CS department which are basically Discrete++ but they were all sans programming.

nlukentoday at 4:29 PM

Northeastern held out for a long time, only switching away from Racket, despite the protest of students and professors alike, in the last year or two.

sheepttoday at 4:35 PM

my high school still uses simply scheme and SICP for the fall semesters of its CS sequence I believe, but granted it's in an affluent city in the Bay and its recently retired teacher came from UCB