[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.


  (setq use-some-behavior t)
  (if use-some-behavior x y)


  (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.]

Run away!  Run away!

reply via email to

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