Live data from Hacker News

Dijkstra on Haskell and Java (2001)

chrisdone.com

191–200 of 253 posts

Re: Dijkstra on Haskell and Java (2001)

#191
post #178

Earlier quoted context omitted.

You can't apply normal functions to monads? Since when? Or what is a 'normal' function?

See all the functions which are funM. mapM, replicateM, etc... For a newbie having to use a different function to apply to a monad vs. a pure function is confusing and not necessary.

I'm just getting confused by the terminology. Those are pure functions too. And you have different functions because they're doing something completely different, operating on computational structures that are different from primitive values the 'normal' functions as you called them operate on.

It's like saying C++/Java etc. are confusing because you can only print certain values, but you can't print the print statement.

Re: Dijkstra on Haskell and Java (2001)

#192
post #43

Earlier quoted context omitted.

Which is more complicated and less expressive than haskell? That seems like a pretty bizarre choice.

When I used OCaml, I almost never used the object system. I didn't need it. The "full" OCaml is pretty complicated, but most of the libraries don't force the "O" on you. (That said, if you're going to use OCaml, you should use the Jane Street libraries, which are far better than the standard library.)

>When I used OCaml, I almost never used the object system. I didn't need it.

Me neither, but it is still part of the language and adds a ton of complexity. Which makes the analogy of ocaml to C vs haskell to C++ quite poor.

>The "full" OCaml is pretty complicated

Precisely the point. The full C++ is pretty complicated too. The full haskell is far simpler than either.

>That said, if you're going to use OCaml, you should use the Jane Street libraries

They didn't exist when I used ocaml, and I would never go back to ocaml now.

Re: Dijkstra on Haskell and Java (2001)

#193
post #44

Earlier quoted context omitted.

>Personally, I see Haskell as the C++ of functional language You should try it some day, it is absolutely nothing like your misconceptions.

I have written quite a bit of Haskell, I'm not sure what you think is wrong with my belief. Also, I like C++ :) Both are fairly big complex languages with horrible error messages, horrible compile times (if you use template haskell in particular), with a whole bunch of gotchas you have to learn to get good performance (the haskell gotchas are very different, and often based around lazy evaluation / memory bloat). Bot…

>I have written quite a bit of Haskell

That is a very common claim from people posting misconceptions that could only arise from second-hand info and a lack of direct experience. I have a very hard time believing it given that you claim haskell is large and complex.

>Also, I like C++ :)

I won't hold that against you.

>what you think is wrong with my belief

Well, everything you just mentioned except the horrible compile times. Haskell is a relatively small language, and is not complex at all. In fact it is quite simple, and very consistent. I don't know what you mean about horrible error messages, and you do not need to learn any gotchas to get good performance. What you need to learn is very simple, very clearly spelled out in the docs, and is no more than you need to learn in any other language. Avoiding unnecessary laziness is no more difficult than avoiding unnecessary strictness. I can't think of a single "sharp edge" haskell has, I suspect we must have different ideas of what a sharp edge is.

Re: Dijkstra on Haskell and Java (2001)

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

> might leave behind students that have not yet been exposed to any programming And good riddance. If you make it to university without exposing yourself to your subject as a matter of passion (and few subjects are more easily approached by hobbyists than programming) you're going to waste your time there. University is a not a "school" you attend for learning a subject. You can't show up for English Literature if yo…

When I got to University, I had very, very little background in the subject for which I eventually got a PhD.

Thank god you're not in charge.

Re: Dijkstra on Haskell and Java (2001)

#195
post #140
post #133

Earlier quoted context omitted.

“Computer science is no more about computers than astronomy is about telescopes.” - Dijkstra It was just too relevant in this case...

"I disagree." - Turing

A Turing machine is not a computer, it's much closer to a mathematician writing down a proof: read a couple of symbols, scratch head, write down symbol, go back again. It's a mathematical model for following a sequence of steps and closely tied to logic, much more so than it is similar to a computer.

Re: Dijkstra on Haskell and Java (2001)

#197
post #127

Earlier quoted context omitted.

> might leave behind students that have not yet been exposed to any programming And good riddance. If you make it to university without exposing yourself to your subject as a matter of passion (and few subjects are more easily approached by hobbyists than programming) you're going to waste your time there. University is a not a "school" you attend for learning a subject. You can't show up for English Literature if yo…

Many of us went into college without the privilege of having a good idea of what we wanted to do with ourselves. In addition to that, among my circle of friends, it's common to know people who switched majors mid-school because they stumbled upon something they found more interesting - isn't that great? They thought they loved something, but found something they loved even more. Or, I guess they should have just been…

Many of us went into college without the privilege of having a good idea of what we wanted to do with ourselves.

Yes, it's quite silly that college is mandatory rather than somewhere you go for the purpose of learning something in further depth.

Re: Dijkstra on Haskell and Java (2001)

#198
post #153
post #133

Earlier quoted context omitted.

“Computer science is no more about computers than astronomy is about telescopes.” - Dijkstra It was just too relevant in this case...

How much weight would you give the opinion of an astronomer (today) who didn't know how to use a telescope?

Many astronomers don't have to use or deal with telescopes, just like not all particle physicists have to know much about accelerators.

Re: Dijkstra on Haskell and Java (2001)

#200
post #33

To me there seems to be something wrong with using as the first language something that depends on a very, very complicated runtime and execution model to run on the hardware we currently are using. This way people end up viewing programming languages as some God-given black box and not just something another computer program written by another person provides for you. I think CS students should instead start by lear…

I'm an advocate of assembly language on microcontrollers being an introduction to programming. PICs are great because they are cheap, basic tooling is cheap, and the instruction set is small. It gives a student a period of getting familiar with computers as machines, rather than brands or software stacks. Plenty of time in the rest of your life for that.

> I'm an advocate of assembly language on microcontrollers being an introduction to programming.

I wish more people had this insight. My understanding of computers blossomed once I found Core Wars back in the day. Curricula like "NAND to Tetris" are probably the way to go when it comes to giving students insights to avoid "black box thinking."

Post reply on HN