Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Style wars: junk comments
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
o...@cs.otago.ac.nz  
View profile  
 More options Sep 12 2012, 6:45 am
From: o...@cs.otago.ac.nz
Date: Wed, 12 Sep 2012 22:45:39 +1200
Local: Wed, Sep 12 2012 6:45 am
Subject: Re: [erlang-questions] Style wars: junk comments

> When trying to "find out what is particular module doing/responsible
> for", on paper, it helps if you can find things. When reading on paper
> it is easier to find things when they are alphabetically ordered.

I suggest that a listing generator that appends a table of contents
mapping each function name to a page number is another way to do this.
I really don't care for any syntactic ordering principle.

For example, separating the exported functions from the private
ones is a bad idea, because I might want to conceal something
that used to be exported, or vice versa, and suddenly what *should*
be a one-line change is a big change.

With alphabetic ordering, again, what *should* be a small change
to the name of a function -- with corresponding changes to callers --
becomes a violent change of place.

I agree 100% that being able to find things alphabetically is
very useful.  If it comes to that, being able to find functions
by who last edited them, or when they were last edited, or how
many bugs have been found in them, &c &c can be convenient.
That doesn't mean that any of these, or any other extrinsic
ordering, is a good way to organise a group of definitions
that need to be comprehended together.

Let's put it this way:
  for things that do NOT have to be comprehended together,
  alphabetic ordering is great;
  for things that DO having to be comprehended together,
  any extrinsic ordering is bad.

Let me give an example.
It's really simple one just to make a point.

    -export([ ... sum/1 ...]).

    sum(Xs) -> add_up(Xs, 0).

    add_up([X|Xs], S) -> add_sup(Xs, S+X);
    add_up([],     S) -> S.

If the comment on sum/1 is not enough,
you have to read them *together*.
But if you separate exported functions from internal ones,
these two functions are on different pages.
If you order function definitions alphabetically,
these two functions are on different pages.

_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.