octave-maintainers
[Top][All Lists]
Advanced

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

Re: is_ignored_output function


From: Jaroslav Hajek
Subject: Re: is_ignored_output function
Date: Mon, 2 Aug 2010 19:46:47 +0200

On Mon, Aug 2, 2010 at 7:26 PM, Rik <address@hidden> wrote:
> 8/2/10
>
> Jaroslav,
>
> I like the new function, but I had two thoughts about the name which I
> think might improve it.
>
> 1) Remove initial '_'
>
> Octave has been moving from "is_XXXXX" to "isXXXXX", for example,
> "is_global" to "isglobal".  Would it be better to call the function
> "isignored_output"?  Alternatively, perhaps we want to indicate that
> functions that begin with "is_" are sort of like variables that begin with
> "__VAR__" and are more for internal and programmer's usage then for users?
>

I think this was mainly for Matlab compatibility. I believe
isignored_output is a bad idea because it mixes two separating styles
(i.e. no style and underscore style). Using underscores has the
advantage that Matlab apparently doesn't use them at all, so it
reduces the danger of a future name clash to essentially zero. Quite
useful for Octave's special built-ins.


> 2) Change "ignored" to verb with positive sense
>
> The common coding case is going to be to check whether an output is needed
> and, if so, to calculate it.
>
> if (! is_ignored_output(2))
>  output(2) = ...
> endif
>
> In English, this common case is a double negative, which is certainly true,
> but harder to understand.  Imagine that I substitute the phrase "don't
> want" for ignored.  I have to ask the question "if I don't (!) don't want
> (is_ignored_output) then ...".
>
> I would suggest a positive verb such as:
> iswanted
> isused
> isused_output
> iswanted_output
>
> if (isused_output(2))
>  output(2) = ...
> endif
>
> Cheers,
> Rik
>

I'm not really against this. Anyone else?


-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
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]