[erlang-questions] Erlang and the learning curve

Henning Diedrich hd2010@REDACTED
Tue Jan 4 16:00:06 CET 2011


On 1/4/11 3:00 PM, Joe Armstrong wrote:
>  ... find the line number of the first error message totally ignore
>  the text that is printed - say to yourself "there is something wrong
>  with this line" mess with the line until the error goes away.
>
>  This method works for all know languages and environments (with the
>  exception of eclipse, where I gave up after days of trying to find
>  out what some error message meant)

How does a noob know she is not confronted, in Erlang, with something
like you experienced with eclipse, and that she could in fact rely on at
least, and exactly, the line number of an error message making sense
- she can't.

 From experience, having seen some strange error messages in strange
places, coming to Erlang, I did not trust the line numbers to indicate
that the error was in fact were the line said. How could I? In fact, I think
you can fool almost any parser to get it wrong, where the error actually
originates. You have to be prepared, especially as a noob, to look
elsewhere for your fault.

Which is then almost a guarantee that you look for 'no match' elsewhere
in the first few days, and assume that e.g. a=1 can't be it. But maybe the
line after that holding a 'case' etc. Even though you read all the
explanations about patterns and for-good binding and atoms being
lower case.

Of course you soon get it, why that is the 'right' message. But why not
be more forthcoming to those folks who probably never meant for the
line to be a match in the first place, but an assignment and haven't gotten
it yet. There is enough stuff to learn, errors get mixed up.

If I remember right, I would have found a hint helpful in the incident.
I did stuff exactly like that above and the problem was not even that
I re-assigned a value but camelCase creep. There are not many
places I'd opt for a modest change, but this one, certainly. I did feel
more left alone with Erlang than with other languages concerning
error messages. If that was for the wrong reasons, that's still not an
argument against that they could be made more newbie-friendly
in a calm moment.

Except of course, you want to have a threshold everybody can fondly
brag about, later. That must certainly be accepted as overriding
point.

Henning



More information about the erlang-questions mailing list