Live data from Hacker News

Dijkstra on Haskell and Java (2001)

chrisdone.com

41–50 of 124 posts

Re: Dijkstra on Haskell and Java (2001)

#41
post #29

As much as I love Haskell, one problem with the intro to CS courses is that many of the students are not CS majors, but students from other disciplines that need to learn a little bit of programming. It makes sense here to teach Java and Python, as imperative languages are more useful to real world programming than functional languages. Perhaps it would be better to create a separate intro course for CS majors. On th…

My alma mater is having this fight between the CS departments and engineering/physics/etc. The CS department switched the first two courses of the intro sequence from C/Java to Scala, moving C to later in the curriculum. Instead of C/Java/C++ in the first three semesters, it's now Scala/Scala/C++.

The department only has 7 professors and is struggling to even offer enough intro classes for their own majors, much less for students in other majors who only need a single CS credit. The engineering department is upset because they want their students to learn C. Physics wants them to know something else, the business department wants them exposed to a tiny bit of Java and so on.

When I started in 2008, there were about 30 freshman taking CS1. Now it's >150 last I heard. They really had no choice but to (diplomatically) tell the other departments to go pound sand. They can't compromise their own majors in favor of those from another department.

My guess is they aren't the only CS department facing this problem.

Re: Dijkstra on Haskell and Java (2001)

#42
post #32

Earlier quoted context omitted.

That day will come, for many of us, when a large AAA game, web browser, or usable OS is written in a FP language. And I realise that is an unfair target, but there is very little user facing FP software. The only one I can think of I have used is xmonad, which is both hard to use and fairly buggy

You mean like Crash Bandicoot, Abuse, Jak and Daxter? Or maybe Genera. Or maybe Remote Agent software used by Nasa Deep Space 1? Or eventually the train control systems running on software from Siscog?

> You mean like Crash Bandicoot, Abuse, Jak and Daxter?

Huh, TIL:

http://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp

Re: Dijkstra on Haskell and Java (2001)

#43
post #8

I don't see why they don't just teach C, x86, and Haskell everywhere. If you know the concepts behind these, you can quickly grok any other programming language. Also I never got the whole hype behind OOP. IMHO its self explanatory, nothing you need an entire course on to be effective and understand OOP programs. Memory layout and management, advanced pointer concepts and monads are a slightly different matter. If I…

They actually do this at the University of Chicago. That's exactly the introductory sequence. The first class in the major is in Racket (Standard) or Haskell (Honors). The second class in the major is in C, and also covers basic UNIX tools. The third class is in x86 assembly and C, focused on understanding low-level systems.

I wish I was there. My curriculum at Carleton University is

  1. Intro to CS in Python ending with a taste of Java
  2. Java
  3. C (intro to UNIX)
  4. C++ (design first, implement after, waterfall, etc.)
Along with 3 there is data structures taught in Java [0] and with 4 there is web dev taught in Node.js.

0: Following this text: http://opendatastructures.org/ Taught by its author, Dr. Pat Morin.

Re: Dijkstra on Haskell and Java (2001)

#44
post #4

I agree with him in the sense that these are CS courses, and in in such a way Haskell ties together well with the math that one learns in a CS program. Keeping that in mind it makes sense to only have taught Java in courses specifically designed for developing software.

I am looking forward to the day the notion that functional languages are not suitable for developing software will die. It is not only that functional languages are more succinct, easier to reason about and are more readable, they also often come with significantly better type systems. Some have type systems sophisticated enough to specify nearly all the legal states and guarantee these are the only states the progra…

Yes, how statically-typed languages deal with dynamic data is one of the interesting features of type systems. In C for dynamic types you resort to void *, in Go it's Interface{}, but in OCaml you can construct a type that identifies exactly what you need.

Re: Dijkstra on Haskell and Java (2001)

#45
post #32

Earlier quoted context omitted.

That day will come, for many of us, when a large AAA game, web browser, or usable OS is written in a FP language. And I realise that is an unfair target, but there is very little user facing FP software. The only one I can think of I have used is xmonad, which is both hard to use and fairly buggy

You mean like Crash Bandicoot, Abuse, Jak and Daxter? Or maybe Genera. Or maybe Remote Agent software used by Nasa Deep Space 1? Or eventually the train control systems running on software from Siscog?

You can do functional programming in Lisp, but even the wiki page for GOAL says "GOAL encourages an imperative programming style". Not to mention most Lisp data structures being mutable if we're talking purely functional.

Re: Dijkstra on Haskell and Java (2001)

#46
post #25
post #18

Earlier quoted context omitted.

The problem is, people finish their CS study, and do not have such level of knowledge that they could start working right away. So Haskell might be nice, but is hardly a sought for skill. Sure if students would learn different stuff by themselves, they could learn useful skills too, but most of the students are lazy, and only learn what they have to.

This is the worst attitude. University is not supposed to be vocational school.

It is de facto vocational school, though, since the demand for jobs generally outstrips the demand for labor and employers decided university credentials were indicative of what they were looking for.

Re: Dijkstra on Haskell and Java (2001)

#47
post #29

As much as I love Haskell, one problem with the intro to CS courses is that many of the students are not CS majors, but students from other disciplines that need to learn a little bit of programming. It makes sense here to teach Java and Python, as imperative languages are more useful to real world programming than functional languages. Perhaps it would be better to create a separate intro course for CS majors. On th…

To followup with a note from the article: "A very practical reason for preferring functional programming in a freshman course is that most students already have a certain familiarity with imperative programming. Facing them with the novelty of functional programming immediately drives home the message that there is more to programming than they thought."

It's no surprise that this attitude can discourage students without programming experience... A parallel intro track seems like a nice solution that has worked in a number of schools.

Re: Dijkstra on Haskell and Java (2001)

#48
post #22

Indeed, my first CS class in 1999 at UT was in Haskell. Wow! What a change it was from high school AP Computer Science in Texas, which was (in those days) C++. Seeing QuickSort in just one line was what hit it home. I remember thinking at the time that this was really incredible, but that Haskell had no future. This was at the time of Hugs 98, although I remember hearing about GHC. I'm glad to be wrong about this.

Hold on: does Haskell allow "the" QuickSort on one line, or just a sort? Because from what I've read, if you want to make Haskell do all the efficient stuff in a QS, you have to tell it a lot more, bloating the program.

Edit: this is what I had in mind: http://augustss.blogspot.com/2007/08/quicksort-in-haskell-qu...

Btw, I took AP Compsci with C++ in Austin around that time, so we might know each other.

Re: Dijkstra on Haskell and Java (2001)

#49
post #8

I don't see why they don't just teach C, x86, and Haskell everywhere. If you know the concepts behind these, you can quickly grok any other programming language. Also I never got the whole hype behind OOP. IMHO its self explanatory, nothing you need an entire course on to be effective and understand OOP programs. Memory layout and management, advanced pointer concepts and monads are a slightly different matter. If I…

and monads

I really don't understand why people have such issues with monads. I don't have a haskell background and originally built up most of my functional programming skill in Python (going somewhat against the grain) and I find monads to be a fancy scary term for an extremely simple concept. I think if they were named something friendlier perhaps people's eyes wouldn't immediately glaze over and they could realise that, actually, monads are just a simple strategy for controlling how things are executed/computed. Computational or execution strategies, if you will. Lets just call them strategies and see if they are less confusing and scary?

Re: Dijkstra on Haskell and Java (2001)

#50
post #29

As much as I love Haskell, one problem with the intro to CS courses is that many of the students are not CS majors, but students from other disciplines that need to learn a little bit of programming. It makes sense here to teach Java and Python, as imperative languages are more useful to real world programming than functional languages. Perhaps it would be better to create a separate intro course for CS majors. On th…

To followup with a note from the article: "A very practical reason for preferring functional programming in a freshman course is that most students already have a certain familiarity with imperative programming. Facing them with the novelty of functional programming immediately drives home the message that there is more to programming than they thought." It's no surprise that this attitude can discourage students wit…

That actually did bother me in the letter.

He states:

-Most students taking CS courses are already familiar with an imperative laguage.

-we are all shaped by the tools we train ourselves to use, and in this respect programming languages have a devious influence: they shape our thinking habits.

This would imply that most CS students already come pre-ruined. At that point then, does it matter what language is picked?

Another alternative would be to start functional languages with data structures and algorithm courses(Generally taken sophomore year, and one of the first CS specific classes taken), and use that to fix broken habits. idk if the professors though want to take time to teach a new language if students already know one.

Post reply on HN