Hacker News new | ask | show | jobs
by the_af 1957 days ago
I think the mistake is the assumption that there must be a quick and easy analogy to a language with C-style syntax (I'm simplifying a bit, but you get the idea).

This is sort of like PG's Blub paradox: the reader opens an article, sees a bunch of seemingly bizarre syntax and novel terminology, can't easily map it to something he/she knows from C/Java/Python/Javascript, and panics.

For some reason people don't assume the same about natural languages. No Western reader will take a peek at a webpage written in Japanese and cry "I can't understand how people speak this language". (Not in this day and age, at least).

6 comments

I'm guessing it's because most people spend very nearly their entire careers nestled comfortably within a single programming language family. So one maybe gets used to the idea that one should be able to decipher an unfamiliar programming language just by reading it carefully, without needing to do any background study first.

It's most pronounced with lisp and ml-style languages, but I've also seen Java lifers bounce off of things as innocuous as Python's list comprehensions.

Prolog can also be pretty mind-bending at first, for people used to imperative programming.
But it's such an enjoyable mind-bend.

I get a little bit wistful when I see people bouncing off of exotic languages. Where's the delight in a chance to discover something new, and the excitement of a new thing to wrap one's mind around? It makes me wonder if some magic has been lost, or isn't being passed along like it should be.

> For some reason people don't assume the same about natural languages.

As mumblemumble says, I think this is due to a blinkered understanding of programming, combined with the mistaken belief that if you know one programming language it's pretty straightforward to learn any other language.

If someone knows Java, Python, and JavaScript, and their idea of exotic languages are Rust and Go, then they have no appreciation of how diverse programming languages really are. Lisp, Haskell, Forth, Prolog, and assembly, will strike them as completely alien, which should be fine except they're under the impression that it's meant to be easy to learn another language.

> No Western reader will take a peek at a webpage written in Japanese and cry "I can't understand how people speak this language".

Well not speak it, but reading it... yes. Japanese writing is like a prank that I would not believe is real... and I still doubt it.

This is a really smart guy with a gift for languages struggling with it: https://www.youtube.com/watch?v=bcdYKxHT8kY (NativLang 7m10s)

...and yet children can do it. Use that as a lesson.

> ...and yet children can do it. Use that as a lesson.

Children? No, it takes them up to middle school to get somewhat proficient with Kanji knowledge for daily life, but they can still not read a lot of Kanji at that point.

Trust me you can learn this too on the same time span and semi-full immersion if you started now.

> This is sort of like PG's Blub paradox: the reader opens an article, sees a bunch of seemingly bizarre syntax and novel terminology, can't easily map it to something he/she knows from C/Java/Python/Javascript, and panics.

I analogize Blub more to Legal Latin: you're using an uncommon reference point to explain the material that could be explained perfectly well without it. The example I'd give is call/cc; I'm sure I could give a thorough description of how call/cc works, and leave a lot of programmers in the dust by doing so. Or I could explain how the yield operator works, and most of those some programmers would suddenly understand what I'm talking about. But they're basically the same thing (the only real difference being that yield continuation magic can only operate within its generator function, whereas call/cc works across function boundaries).

> you're using an uncommon reference point to explain the material that could be explained perfectly well without it

Should Haskell practitioners cater to C-like developers? If so, why bother with Haskell at all? This is one step removed from saying "just write an improved C and forget about Haskell", and in fact there have been attempts at it! It's just that they aren't Haskell.

Is it too much to ask of people trying to understand Haskell code to learn about it first?

And Haskell syntax is much easier to learn than Japanese syntax. (And Japanese syntax is itself easier than you might think.)
While true, there's a certain level of "we must use math concepts to describe things", which while true sometimes just seems unnecessarily silly. "The Monoid 'Natural Numbers under Addition' is associative" => "putting brackets in any place when adding >2 numbers doesn't change the result".

It adds to the perception of "I need to understand masters level maths to use Haskell".

I really... don't understand your objection. What's silly about using the word "associative"? That's high school level stuff, not rocket science.

What about words like "operator", "function", "mapping"? Those are all from math too.

Associative - nothing. But "Monoid 'Natural Numbers under Addition'" is a fancy name for adding numbers since we don't really care about the concept of monoid in this case.
But we do care. Once you put a name to something, you realize it can generalize beyond numbers and addition. If you don't name it, you don't see the generalization. And these generalizations matter a lot because Haskell is built out of them.

Besides, learning what a "monoid" is is not harder than learning what a for-loop is or a hash map. They aren't natural concepts, but they are easy to learn by programmers.

I don't think it matters in this specific case. (and if the generalisation really matters, why would we restrict it to natural numbers?) Sure, every single concept mentioned is simple in isolation - but put enough of them together and it's starting to become an effort to process unless you're used to that kind of communication.

To compare it to spoken communication, there's a threshold where very formal queen's English from an extremely eloquent person makes them sound like an obnoxious showoff rather than fancy and serious. I feel like posts about Haskell often touch that threshold without a good reason. But that's my very subjective opinion.

> why would we restrict it to natural numbers

We don't, that's the point. We abstract it above numbers, so that we can find that lists and natural numbers and many other things share the same "shape" when looked at from certain perspectives.

It's not about showing off, but about finding generalizations -- finding the "shape" of things -- that allow us to use the same abstractions over them.

And to talk about these shapes, we must use the appropriate vocabulary. It's shorter and more precise. Just like you say "function" instead of explaining what it means in lots of words every time you mean function.