Hacker News new | ask | show | jobs
by vezzy-fnord 3906 days ago
I never understood why Erlang syntax has been so commonly maligned. I had no trouble getting through Joe Armstrong's Programming Erlang in less than a week, and the syntax never required any conscious moment to "click," it just flowed right past. The only exception at first was the operator precedence rules inherited from Prolog, but those are memorized quickly.

I also didn't have in-depth prior experiences to non-ALGOL languages all that substantively. I had experimented with Scheme, OCaml and REBOL (and read documents on Prolog, but barely typed much of it) before, but nothing fancy.

2 comments

I think I may be more representative of the camp complaining about erlang's syntax. My background is as a sysadmin without CS training, with only prior experience using ruby, python, and shell scripting.

It took me about four months of hard studying for erlang to click. I think it was due to learning some CS fundamentals (e.g. had never heard of a tuple before, never seen multiple dispatch), learning functional programming fundamentals (had never used a purely functional language before - unless you count bash), and had never looked at prolog. Finally, I was simultaneously exposed to new concepts of concurrency, pattern matching, etc.

I think what happened was that the unusual syntax is the easiest thing to blame for the resulting confusion, because it's the surface layer you engage with.

Ah, that would make sense. I already had some knowledge of general computing "culture" before learning Erlang, so I did not stall much on the broader concepts. Erlang is more heterodox, so it's likely the ideas could be an initial obstacle.
> e.g. had never heard of a tuple before

You never encountered tuples in python?

I think that generalizing from your own personal experience is probably a bad idea here. I personally learn syntax very easily probably because I place very little emphasis on syntax and far more on semantics. However I have met people who place a lot of emphasis on syntax. For them the syntax of a language is a large hindrance.

I suspect there are people for whom syntax has a large impact on productivity. Especially when first getting familiar with a language. I don't think downplaying that is wise.

It's much more complex than that. Learning new syntax, for example, is completely different beast than actually using the syntax. Syntax has non-trivial - and rarely understood - influence on code readability and language idioms. Constructs with syntactic support tend to see more usage than the "bare" features - it takes a language as impoverished as JavaScript to convince people that they don't need syntactic sugar to use those features. Language syntax affects tooling to a great extent. And so on.

So, in short: syntax does matter, although in a different way than most people think.

On the other hand, people who are fixated on some syntax should just stop. Writing a couple of lexers/parsers helps here. Knowing different kinds - of flavours - of syntax helps even more. Syntax does matter, but not nearly as much as such people seem to think.

The point is Erlang's syntax is something of a joke for whatever reason, so I figured I'd offer a counterexample.

Honestly I see it as just slightly less juvenile than "Lost In Stupid Parentheses".