[erlang-questions] Why we need a -module() attribute?

Loïc Hoguin essen@REDACTED
Thu Feb 25 01:53:00 CET 2016


On 02/25/2016 01:24 AM, Richard A. O'Keefe wrote:
> On 24/02/16 10:46 pm, Konstantin Vsochanov wrote:
>> On 2/23/16 01:30 , Richard A. O'Keefe wrote:
>>> I do not recall ever seeing -module coming up here before.
>>> I certainly don't recall a long thread like this one.
>>>
>>> Maybe because people who stumble over -module() too shy to write to
>>> erlang mail list?
>
> That seems highly unlikely.  People complain about all sorts
> of other things; why should they be shy about this one alone?

They're not. What is highly unlikely is to hear about small problems on 
the mailing list, because few beginners register here, and it's rarely 
to ask beginner questions (Roelof posts a lot but is just one). Few 
people care about that sort of thing once they're used to it. Same goes 
for all small annoyances brought up by beginners again and again.

You are a lot more likely to hear beginner feedback in person (often in 
the form of a question: if a question comes up often, that's a smell, or 
by making mistakes) or where beginners go to get help (IRC, 
StackOverflow and so on). But most of that feedback will usually not go 
as far as the one in this thread which points out something that is felt 
unnecessary.

A similar but larger pain point that's been rationalized by people used 
to Erlang is the expression separators. It comes up regularly on the 
mailing list, but comes up a lot more outside, and even more when 
teaching people. It's probably the most frequent beginner mistake. You 
can explain it off perfectly, sure, but it'll remain the most frequent 
beginner mistake. The only way to fix that is to forget those perfect 
explanations, admit this is a problem and fix it. (I would write the 
fix, Steve, but it's even less likely that this kind of patch would get 
merged as things stand today.)

I get the feeling from this mailing list that if something has a perfect 
explanation there's no reason to change it. That's partly why I think 
maps are a miracle (we had the dict module already after all). But 
that's wrong. Things that give unnecessary trouble to people should be 
changed, regardless of the accuracy of the explanation you can give to 
people when they run into trouble/get fed up with it.

-- 
Loïc Hoguin
http://ninenines.eu
Author of The Erlanger Playbook,
A book about software development using Erlang



More information about the erlang-questions mailing list