Live data from Hacker News

Dijkstra on Haskell and Java (2001)

chrisdone.com

11–20 of 253 posts

Re: Dijkstra on Haskell and Java (2001)

#11
post #9
post #3

A problem I've noticed in my degree is that for a certain percentage of students Java just doesn't stick. I'm in my fourth year now and there are plenty of people who just can't program, because they've only been taught Java, and they didn't get that. It's far too big a language to teach in a semester or two to a previous non-programmer. Even if it does sink in they rapidly find that the simplified Java being taught…

Java is definitely a terrible language for teaching and as a student's first introduction to arrays, memory handling and flow control it's pure terrible. However, Java is incredibly effective as a language for large teams. Since most of the companies coming to hire CS grads are big teams in need of extra hands on their software projects, they are looking for CS grads who know Java. So Java in universities is generall…

> Java is definitely a terrible language for teaching and as a student's first introduction to arrays, memory handling and flow control it's pure terrible

Sadly, teaching OS classes with Java is a thing: http://www.amazon.com/Operating-System-Concepts-Abraham-Silb...

Re: Dijkstra on Haskell and Java (2001)

#12

I have to say that Java is the absolute worst language for pedagogy. Before people can write "Hello world", they're told they have to write "public static void main(String[] args)", which are presented as magic incantations, "don't worry about those yet". Thus begins the corporate-style coding culture of bashing stuff without understanding it. The stated reason for starting in Java is so that students can get coding…

Just because you should not explain to students what "public static void main(String[] args)" is the first day does not mean that you can never teach them. Actually, if your students cannot understand what this line is after one full class of Java, then the problem is with the teacher, not the students.

The important part is not the 'never.' The important part is that the _very first thing_ you tell new programmers is "Don't worry about this, it's magic, just ignore it."

This sets a certain kind of tone and expectation about programming that's quite poor.

Re: Dijkstra on Haskell and Java (2001)

#14
I would guess Haskell would be perfect if the goal is to produce academics. But if most of your students are destined for industry, Haskell is in my opinion the absolute worst language.

- You'll probably get a high drop out rate because of the complexity (recursion, pure / first class functions etc).

- You rely that your students already have experience at high school with imperative languages

- The industry by far still don't use functional languages.

But then again Java is an equally bad choice, for the reasons mentioned, but also you jump immediately into OOP, again expecting the student to have former experience.

What is wrong with laying a solid foundation with the introductory class in C or Python, and then moving on to the more advanced OOP or functional worlds?

Re: Dijkstra on Haskell and Java (2001)

#16
Dijkstra assumes that students will already have been exposed to imperative languages before joining university, and will appreciate the change. I think that this assumption might leave behind students that have not yet been exposed to any programming (that stuck).

Over in the UK I certainly hadn't encountered anything more complicated than html before I hit university, and was very happy with sticking with Java for the entirety of first year. I had been exposed to C++, ADA(!), Prolog and had an in depth look at Erlang by the time my course finished...

Re: Dijkstra on Haskell and Java (2001)

#17

I have to say that Java is the absolute worst language for pedagogy. Before people can write "Hello world", they're told they have to write "public static void main(String[] args)", which are presented as magic incantations, "don't worry about those yet". Thus begins the corporate-style coding culture of bashing stuff without understanding it. The stated reason for starting in Java is so that students can get coding…

While I personally agree with teaching something other than Java, there is one big advantage of Java you have overlooked-- as the core language is so simple, bugs caused by incorrect use of the language tend to be "shallow" (bugs caused by algorithmic mistakes can still be very complex of course). An easy example of this is compile-time errors -- the most complex compile time error you can get of Java tends to be not…

I agree with the point, but the argument -- that by arbitrarily ignoring features you come up with a simple core language -- can be applied to Haskell (and pretty much any other language) as well.

If you exclude typeclasses, extensions, and IO from Haskell, you get a very simple language. (I personally find the error messages easy to understand when avoiding those)

Related: how GHC compiles Haskell code, including the "Core" language and lots of desugaring.

Re: Dijkstra on Haskell and Java (2001)

#18
The first programming language we learned at university was ML. It was a very simple language for teaching functional programming, it has a minimal syntax that makes some sort of sense and it was likely that everyone was starting off at the same point with it.

Like Dijkstra said, getting these high-level concepts in there early is very important.

Re: Dijkstra on Haskell and Java (2001)

#19
post #3

A problem I've noticed in my degree is that for a certain percentage of students Java just doesn't stick. I'm in my fourth year now and there are plenty of people who just can't program, because they've only been taught Java, and they didn't get that. It's far too big a language to teach in a semester or two to a previous non-programmer. Even if it does sink in they rapidly find that the simplified Java being taught…

That's a problem regardless of the specific language taught first and I say that having personally witnessed the struggles of students who learned in pseudocode (my first semester), Java, Python, and Scheme. Programming requires you to structure your thinking a particular way. It's natural for some people, it's unnatural for others. I tutored a couple dozen people of varying aptitudes through the courses as an undergrad and was suprised at how little a difference Java vs Python made.

I do think that there are better ways and worse ways to teach programming. Brett Victor put out an overview [1] of the topic last year and while that essay in itself isn't the answer, it's at least a better start than anything I ran into as an undergrad.

[1] http://worrydream.com/LearnableProgramming/

Re: Dijkstra on Haskell and Java (2001)

#20

Earlier quoted context omitted.

Just because you should not explain to students what "public static void main(String[] args)" is the first day does not mean that you can never teach them. Actually, if your students cannot understand what this line is after one full class of Java, then the problem is with the teacher, not the students.

The important part is not the 'never.' The important part is that the _very first thing_ you tell new programmers is "Don't worry about this, it's magic, just ignore it." This sets a certain kind of tone and expectation about programming that's quite poor.

Or you can say: "Don't worry about this now, we will explain it later" :-)
Post reply on HN