3 ms·
The Erlang syntax isn't that bad. Don't be intimidated by it. You mention the line ending punctuation as a specific cause of concern which is difficult to lea
by marcc 16y ago
The Erlang syntax isn't that bad. Don't be intimidated by it. You mention the line ending punctuation as a specific cause of concern which is difficult to learn. Let me try to help:
To start, a comma goes at the end of a normal line of code. Most lines end in a comma. There are exceptions though, but easy to manage ones. A semicolon will go at the end of a case statement or an if statement. But no punctuation goes at the end of the last case or if statement in a block. The same logic holds for ending a function. A function is ended with a period, unless there is another function with the same signature. In this case, you end with a semicolon.
I answered a similar question on SO a while back:
http://stackoverflow.com/questions/1110601/in-erlang-when-do-i-use-or-or/1110623#1110623 http://stackoverflow.com/questions/1110601/in-erlang-when-do...
That was my answer back in '09 as I was learning Erlang. I absolutely love the language and agree that there is a learning curve, but the syntax learning curve is pretty small.
- deleted 16y ago[deleted]
- Lewisham 16y agoThis is great, thanks :)