[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mh-e 6.2 imminent
From: |
Miles Bader |
Subject: |
Re: mh-e 6.2 imminent |
Date: |
25 Oct 2002 14:50:00 +0900 |
Richard Stallman <address@hidden> writes:
> The idea of this convention is to make it easier to figure out the
> precise meaning of the variable from its name. It would be a useful
> convention if it were followed more consistently.
My argument is that adding `-flag' rarely does make it any easier to
figure out the meaning, and it makes code much uglier.
Compare:
(setq use-some-behavior t)
(if use-some-behavior x y)
with:
(setq use-some-behavior-flag t)
(if use-some-behavior-flag x y)
In situations like this, `-flag' just screams `redundant!' (it feels a
bit like code that says `if (var == true)').
I don't know if this is an inherent property of boolean variables (as
opposed to a convention like using `-function' with variables that
should hold a function, which does seem genuinely useful), or just
something that results from familiarity with existing convention, but it
seems quite obviously true to me.
One theory I have is that boolean variables are usually named as if
they were verbs, e.g. `do-something', which implicitly tags them as
being boolean (and which is why `-flag' seems redundant).
[Other variable are usually nouns, and what adding `-flag' does is try
to convert the verb-forms to noun-forms -- but programmers are already
used to the verb forms from long usage, so this apparent improvement
in consistency actually just confuses things.]
-Miles
--
Run away! Run away!
- Re: checkdoc (was: mh-e 6.2 imminent), (continued)
- Re: checkdoc (was: mh-e 6.2 imminent), Richard Stallman, 2002/10/29
- Re: checkdoc (was: mh-e 6.2 imminent), Miles Bader, 2002/10/28
- Re: checkdoc (was: mh-e 6.2 imminent), Kim F. Storm, 2002/10/28
- Re: checkdoc (was: mh-e 6.2 imminent), Miles Bader, 2002/10/28
- Re: checkdoc (was: mh-e 6.2 imminent), Kim F. Storm, 2002/10/28
- Re: checkdoc (was: mh-e 6.2 imminent), Henrik Enberg, 2002/10/29
- Re: checkdoc (was: mh-e 6.2 imminent), Stefan Monnier, 2002/10/29
- Re: checkdoc (was: mh-e 6.2 imminent), Richard Stallman, 2002/10/29
- Re: checkdoc (was: mh-e 6.2 imminent), Miles Bader, 2002/10/29
- Re: mh-e 6.2 imminent, Richard Stallman, 2002/10/25
- Re: mh-e 6.2 imminent,
Miles Bader <=
- Re: mh-e 6.2 imminent, Richard Stallman, 2002/10/26
- Re: mh-e 6.2 imminent, Francesco Potorti`, 2002/10/29
- Re: mh-e 6.2 imminent, Peter S Galbraith, 2002/10/29
- Re: mh-e 6.2 imminent, Richard Stallman, 2002/10/30
- Re: mh-e 6.2 imminent, Miles Bader, 2002/10/29