[erlang-questions] Which choice is better? Function or Case
Sat Mar 9 17:39:53 CET 2013
Yesterday I found myself wishing for a one letter variable name. The code said " unitname ", but what was wanted was unit identity. A single letter would have been less missleading.
Sent from Moxier Mail
----- Ursprungligt meddelande -----
Från: Henning Diedrich <>
Till: Gianfranco Alongi <>
Kopia: 饕餮 <>, erlang-questions <>
Skickat: 09-03-2013 3:13 em
Ämne: Re: [erlang-questions] Which choice is better? Function or Case
I realize I keep coming back to the question, even on Saturdays, did Gianfranco mean more comments, or less.
On Mar 8, 2013, at 1:54 PM, Gianfranco Alongi <> wrote:
> Therefore, minimize the time needed to read your code, making it cheaper.
In likeliness, I fancy, you meant neither and the balance between cluttering the source into unreadability or under commenting is as delicate as the coding itself.
While the language already offers different ways to achieve the same thing, how much more liberty is there in commenting.
Robert one time suggested the Church of Short Variable Names to me as a way to reduce Erlang's occasional verbosity.
Once you dare writing one-letter variables, it makes a difference like night and day. It is, on the face of it, so much easier to read.
But using single letter variables all but makes comments part of the code. One may claim the code to be close to useless without the comments.
Since we just saw specs evolving from comment annotations to language part, I wonder if that is a pointer:
what part of the comments are to be considered mandatory part of the code, beyond specs, which latter had type verification as focus.
What other commenting part that has semantics as focus would emerge, not to create new restrictions but as a guide line to support one's future self, or whoever inherited your code?
This, in part, goes back to Joe's proposal to annotate the Internet. While that was not about form but more of a technical discussion, the inspiration is similar.
erlang-questions mailing list
More information about the erlang-questions