|
Authored by: Anonymous on Friday, April 20 2012 @ 07:05 AM EDT |
Not really refuting anything you say. Just adding some comments/facts.
GNU was never part of the JCP, the JCP is a discussion club (with somewhat weird
member rules which GNU people were not comfortable with). GNU only needed
descriptions of the java language/api to implement them for GNU Classpath, which
can be done just using books describing them or public online documentation.
The Sun javac isn't the only compiler implementation to turn source into byte
code. There is the GNU Compiler for the java programming language (gcj) and the
Eclipse compiler for the java programming language (ecj) which do the same job
of turning source code into object code (gcj can even produce native code, next
to byte code, again an implementation detail).
https://en.wikipedia.org/wiki/GNU_Compiler_for_Java
https://en.wikipedia.org/wiki/Java_compiler
Some of these compilers are implemented in the java programming language
themselves others are implemented in C or C++.[ Reply to This | Parent | # ]
|
|
Authored by: BitOBear on Saturday, April 21 2012 @ 05:28 AM EDT |
One of the things the max() function definition told me as a programmer that I
didn't know, is that max() is stable with respect to NaN (not a number) values.
I only vaguely understand why b doesn't need to be checked but if it matters I
can go find out.
So source code communicates with the compiler/machenery but it -also-
communicates with the programmers that follow.
Were I to decompile the code the and read that, instead of the source, I
wouldn't know why the code is as it was.
But that "why" isn't necessarily expressive, its protective. Without
the comments a later programmer could come along and -guess- that the term
"if (a != a) return a;" is a meta term, either existing for debugging
purposes or as leftover from some other version of the routine. Having made that
guess the programmer might wrongly remove the term as a clean-up action.
So the comment tells me that since NaN can never be equal to anything including
another NaN, this will make sure that if A is an NaN then max() will return
NaN.
When I put on my "experienced programmer" hat I know that the code
could read "if (a != a ) return NaN" but that would be far less
efficient since we have a somewhere already and it is computationally faster to
hand back something that is handed to you than to hand back a constant you have
in your pocket. (long technical reason elided here).
So the code is a proper use of the machine, it is purely functional, but the
intention of invoking that function is not obvious to a less skilled or less
familiar programmer, so the comment is there. But the comment is there not as a
"creative expression" but as an explanation of the mechanical
function, and a working one since it will effectively protect the code from
well-meaning human interference.
So even the comment parts, if they are good comments, are not a medium for
creative expression, they are a medium for functional expression. They have use
and value. They just aren't purely creative.[ Reply to This | Parent | # ]
|
|
|
|
|