Live data from Hacker News

Dijkstra on Haskell and Java (2001)

chrisdone.com

51–60 of 253 posts

Re: Dijkstra on Haskell and Java (2001)

#51
post #39

Earlier quoted context omitted.

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.

It may be turning around now, but applicants for compsci at Cambridge were apparently getting pretty dire by 2006, and this formed a significant part of the motivation for the Raspberry Pi ( http://www.raspberrypi.org/about ) > The idea behind a tiny and cheap computer for kids came in 2006, when Eben Upton, Rob Mullins, Jack Lang and Alan Mycroft, based at the University of Cambridge’s Computer Laboratory, became co…

Strangely I found myself struggling to pick up Standard ML despite having experience in C++ compared to my peers with no programming experience. It seems that they just treated it as math, while I had trouble changing my imperative programming mindset.

Also Larry Paulson is a legend.

Re: Dijkstra on Haskell and Java (2001)

#52

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.

> 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 think you're dead wrong about that. Assuming somebody with no programming background at all, here is a (definitely not exhaustive!) list of things that must be learned in order to understand that line:

Method visibility, what is a "method", what is a "function", what is a "class", probably what is an "object" (because it is otherwise difficult to understand why a "class" is a useful construct), "static" methods, either need to hand-wave the use of the term "static" for methods associated with a class or know a reasonable amount of history and/or computer architecture, the idea of a "return type", oh, the idea of a "type" come to that, "void" itself, "main" and generally the idea of a program entry point, function arguments, the "String" type, what is a "character", how are characters made into a "String" (arrays and encodings with various amounts of hand-waving), the "[]" syntax, and arrays of arbitrary length.

A class period is, what, 2 hours? No, it doesn't matter how good you are as a teacher, you can barely cover all that material in a single period, let alone do so in such a way that the students have any idea what you're talking about. Teachers finding themselves a month (or three!) down the road telling their students "now you have enough background to go back and understand the very first line of code you wrote!" is absolutely an anti-pattern.

[edit: formatting and typos]

Re: Dijkstra on Haskell and Java (2001)

#54

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…

Industry is far too low a bar to aim at. College should give them the fundamental understanding of programming that they can apply to a variety of situations. Employability flows out of that.

Re: Dijkstra on Haskell and Java (2001)

#55
post #47
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…

> Dijkstra assumes that students will already have been exposed to imperative languages before joining university For those entering CS, this is probably true. But it's also probably true that that's because of the students' own initiative to investigate a topic that interests them. I think high schools have gone the opposite direction. In the 80s, most high schools had some sort of computer class (often taught on TR…

Addendum: High schools also used to teach typing (on typewriters). Now that keyboards are ubiquitous, typing classes have inexplicably been dropped. Go figure.

Re: Dijkstra on Haskell and Java (2001)

#56
post #49
post #38

Earlier quoted context omitted.

Your first paragraph seems to be entirely nonsense. Almost everyone was first introduced to a high level language. This did not prevent anyone from understanding that those languages are themselves software, written by people. In fact, you generally have to take a whole course on compilers.

Knowing the single fact that a language is ultimately a piece of software is different from having an intrinsic understanding that each high level construct has to be somehow translated to what the computer can do. Everyone learns the fact "compilers provide programming languages" pretty quickly, but beginning programmers don't get early enough into the habit of thinking how what they write in a high level language t…

And you realize that machine code has to be translated to how electrons are routed right? Do you have a good understanding of how that works?

Embrace abstraction folks.

Re: Dijkstra on Haskell and Java (2001)

#57
One of my favorite things about heaving to learn Scheme in my intro CS course was that it put most students on an even footing with regards to already (not) knowing the language. It's awesome to see Dijkstra alluding to that, "it drives home the message there is more to programming than they thought."

I'm having a ball learning Clojure now, and it would be much much harder if I'd never used Scheme. (I've done some functional programming in C++ and Ruby, but I wouldn't have done that if I hadn't done it in Scheme earlier.)

Re: Dijkstra on Haskell and Java (2001)

#58

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…

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

For C at least, you have a hard time with the syntax on first exposure. Unless you want to teach the idea of "Grammar" as a concept as well. "Why doesn't the for statement have a semicolon after it?" is a common question. It's simply an irregular and ad hoc syntax. After working with freshmen learning C as their first language, I am confident it's a terrible starting point. Others might be worse, however.

Given freedom, I would likely pick Scheme as a starting point, with SICP as the text. Regularity of syntax is extremely important - the only thing your mind really should need to worry about is how to reshape itself to the semantic demands of programming.

Re: Dijkstra on Haskell and Java (2001)

#59

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

Compare to this:

    #include 
    
    int main() {
        printf("Hello world!\n");
        return 0;
    }
Woo! Your first program and I count, at most, 2 things that could be described as "magic" for someone who's never seen C before (the stdio library and double quotes being syntactic sugar for an array of chars). Even then, those two things are deterministic, so they won't remain magical for long.

Re: Dijkstra on Haskell and Java (2001)

#60
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…

I already had math research experience with C when I finally took my schools introduction to CS course, and had wrapped my head around pointers and recursion. Java just felt like memorizing a bunch of strings and exceptions.
Post reply on HN