Live data from Hacker News

Dijkstra on Haskell and Java (2001)

chrisdone.com

21–30 of 253 posts

Re: Dijkstra on Haskell and Java (2001)

#21

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.

I strongly disagree with you. Public, static and void refers to three concepts that are not easy to grasp for starters. After a course they might more or less know what is the magic doing but in most cases they don't understand the underlying mechanism.

On the other hand, you will get students distracted by all those concepts and they don't spend time in what it matters on that level (learn how to make the machine to compute)

This doesn't happen in Scheme (for instance) where everything is clear and simple, two qualities that are great for starters and let them to focus in the algorithm part rather on the language shenanigans.

Re: Dijkstra on Haskell and Java (2001)

#23
post #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…

What year did you enter university? I know the number of kids exposed to programming before university now is much higher than it was when I entered in 1996. I think it's safe to assume (but would love to have some real data) that most CS freshmen these days have dabbled with at least one of the mainstream imperative languages before they hit uni.

Re: Dijkstra on Haskell and Java (2001)

#24
post #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…

Despite the fact that I learned imperative style first (as most have) -- I think that functional programming is also a valid start point. I don't know that you necessarily benefited from starting in Java/some other procedural language.

I actually graduated from UT's Comp Sci school and I know many of the "elements" courses (super introductory, even for non-majors) are taught in python. That, I think is a good introduction, but for people in the major, I don't think learning Haskell/functional programming is a stretch at all.

If one can wrap their minds around functional programming (which introduced correctly is actually relatively easy to grasp) -- it will be MUCH easier to learn imperative programming. In the end, any good imperative programming seeks to be modular (s/procedures|methods|subroutines/functions/g), and will liken itself to something you would write in functional programming (loosely couple functions that do a specific task well). Yes there are places this gets hairy (side effects, I/O based operations), but computer science is not about writing procedural code, it's really more about algorithms, which is why 4 year universities are NOT trade schools, but do prepare you for the real world (in that you're not COMPLETELY useless). Program syntax is easy to learn (a skilled faker can just repeat it verbatim), efficiency/correctness/proper data-structure usage is difficult.

Re: Dijkstra on Haskell and Java (2001)

#25
post #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…

I think many degree programs assume you have programmed before even if it is nothing substantial.

I know my university's first class in programming assumes prior experience (though nothing to worry about for a motivated student) and then offers an introductory course in python for students with no experience if they'd like. The University in question is still stuck in Java for the main courses like many other Universities.

Re: Dijkstra on Haskell and Java (2001)

#26

Earlier quoted context omitted.

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" :-)

... which still gives the same impression: code is magic.

Re: Dijkstra on Haskell and Java (2001)

#27
post #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…

I think that this assumption might leave behind students that have not yet been exposed to any programming (that stuck).

Let me provide some anecdotal counter-evidence: during my last year of high school, I was in a university class where they taught us programming using Haskell (this was in 2000). I observed a fairly consistent pattern - those who had prior experience with imperative programming (me included), had far more difficulty picking up Haskell than those who hadn't.

The girl I worked with (who had no prior experience) was surprised, since "it's just like maths" :).

Re: Dijkstra on Haskell and Java (2001)

#28
Around the same time, my alma mater was switching from Scheme to Java for their introductory courses.

Last time I went back to homecoming, it seemed that most the professors were feeling pretty dissatisfied about the decision. One of the big reasons mentioned was that Java's just too big and hairy of a language. They end up spending all their time teaching API quirks and software engineering principles (such as pretty much the entire subject of OOP), leaving little time to focus on much more important basic skills such as breaking a problem into smaller pieces and attacking a problem in an organized manner. Or even simple stuff, like the difference between a value and a variable. They also lamented the loss of a REPL, which is an invaluable tool for enabling (and encouraging) students to experiment and get a better understanding of how a programming language actually works.

For my own part, I wonder if the current cultural unfashionability of OOP isn't somehow a result of the vogue for switching CS programs over to Java around the turn of the century. I find myself thinking that what a lot of newcomers to FP seem to think of as problems inherent to object-oriented programming are really just problems inherent to not having worked your way through SICP during your formative years.

Re: Dijkstra on Haskell and Java (2001)

#30

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 s…

Downvoted because OOP is not necessarily more difficult than C for a beginning programmer, and Haskell is not a "purely academic" language.
Post reply on HN