octave-maintainers
[Top][All Lists]
Advanced

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

is_ignored_output function


From: Rik
Subject: is_ignored_output function
Date: Mon, 02 Aug 2010 10:26:08 -0700

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?

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


reply via email to

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