octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: the competition's expm vs ours


From: Jaroslav Hajek
Subject: Re: the competition's expm vs ours
Date: Wed, 10 Dec 2008 20:15:35 +0100

On Wed, Dec 10, 2008 at 2:45 PM, John W. Eaton <address@hidden> wrote:
> On 10-Dec-2008, Jaroslav Hajek wrote:
>
> | A comment after code should start with #.
> | There's nothing describing ### comments.
>
> They would be used for comments that are not indented at all, no
> matter where they appear.  I don't think these are used anywhere in
> the Octave sources.

I'm still not getting it. In the source, the line *is* already
indented. The leading whitespace is part of it. So why not always on
comment sign? Or does Emacs somehow change indenting of lines when
displaying files? If yes, can't it be simply configured not to do so?
Or is the purpose that you can automatically reindent files using
Emacs? Come on, how often you do that? And even if there's need, it is
possible to do it without requiring a special sign for each type of
comment, isn't it?

>
> | Is this correct? The text also says the # comments should be aligned,
> | but doesn't specify it:
> | Does it matter to what column? Can it vary throughout the file?
>
> I don't think it matters.  But the idea would just be to try to write
>
>  foo ();        # comment foo
>  other_foo ();  # comment foo
>
> instead of
>
>  foo (); # comment foo
>  other_foo (); # comment foo
>
> But I generally try to avoid these kinds of comments anyway.

So do I. And most other contributors, as it seems. So why require the
speciality?

>
> | In that case, I'd like to note a quickscan just showed that people
> | write ~ 6 times often code on stand-alone lines
> | (not counting comments starting in the leading column).
> | Just try in the scripts dir
> | grep ' # ' `find -name '*.m'` | wc -l
> | grep ' ## ' `find -name '*.m'` | wc -l
> | So, could it be done the other way around? # for stand-alone, ## for
> | trailing comments?
> | It's easier to type a single comment sign than double, so IMHO it only
> | makes sense to let the more often used to be the easier to type.
>
> This style follows the comment convention used for Emacs Lisp files.

Yeah I was afraid that it's something like that :)

> I understand the complaint about ease of typing (it is easier to type
> the Lisp comment character, at least on US keyboards) but I'd rather
> not change this convention now as it would generate a really large
> diff for what I see as little benefit, and would disrupt applying
> patches for a while.

Too true, unfortunately. Still, there's an alternative: We can simply
relax the rules to the point that a single sign is sufficient
anywhere, but two are acceptable. (Except maybe the texinfo doc
block). I vote for that, because IMO any new contributor is going to
wonder why we require double comments (and only Emacsists will agree
with the reasoning). We should adjust our tools to our preferences,
not vice versa.
But if I'm outvoted I'll change my sources that violate this rule (or
all sources, there are a couple others). Hmm. I guess getting used to
it won't be easy.
Also, unfortunately, by default ViM is not able to format these
comments so I guess newcomers using ViM will have trouble. Like I had.
Sigh.

regards

-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

[Prev in Thread] Current Thread [Next in Thread]