On 12/14/2012 2:47 PM, markspace wrote:
> [...]
> I wonder, in general, where the line should be drawn? Java coding
> guidelines recommend that 1 and -1 can be used as literals, but other
> integer constants should defined as a "constant" by the programmer.
Java coding guidelines suggest -1,0,1 can be literals,
but only in `for' loops. Use them elsewhere, or use those
values in any type other than `int', and you're supposed
to use a `static final'. That is, the guidelines frown
on `q = 1.0 - p;' and even on `System.exit(0);'.
What utter nonsense!
Let's not forget that the Java coding guidelines come
from the same minds that made `byte' signed, invented
Integer#getInteger(String), and designed java.util.Date.
Consider the source.
--
Eric Sosman
d