|
Authored by: celtic_hackr on Sunday, May 06 2012 @ 03:21 PM EDT |
Well that didn't take long.
C++ Standard Library API
* char getenv( const * char name)
Java System.out API
static string getenv (string name)
Looks like Java took the getenv straight from the C++ API, without attribution
or permission or anything.
The non-programmers amongst us may be confused by the "* char" versus
"string".
The first one being a "pointer to an address of a character array"
whereas a string does all that low level handling of things to make using and
accessing the "* char" easier and simpler. But they both do the same
thing, namely, save a string of characters to a certain location for reading and
writing.
While the "* char" and the "string" are not generally
interchangeable. Only one of these is interchangable in this case. and that one
is the "name" pointer/string. I could be wrong here, but I think Java
passes the address of variables to procedures by default. If so then they are
equivalent. Java, however, returns a "static string", which I'm not
sure but I'd wager a static string is actually an address and that fact is
hidden to make it appear to be a actual string [explanation below], and C++
returns an address which tells where to find the string.
This is something that most programmers, I think could agree, is
"substantially similar". The changing from address to content was a
trivial and insignificant change.
If I were of the bent to say APIs are copyrightable, I'd call this infringing as
a blatant attempt to hide plagarism.
Explanation note on "static string". A static string sounds to me to
be a persistent value variable. Meaning, it retains it's value in a
"permanant to the program" location. That means that if you create a
variable in a particular scope, and then leave that scope and come back the
value you last assigned it is retained. Not being a Java guy, Java may mean
something very different here.
One way to think about this is a room, with a deaf guy sitting in it. You open
the door and enter the room (enter the context of the room). In one case you say
5 and leave, in the other you give the man a flashcard with the number 5 on it.
Later you come back into the room. In one case you can't remember the number you
shouted out and the guy can't help you, as he didn't hear the number, in the
other he gives you the flashcard with the 5 on it. The flashcard case is the
static, or persistent case.
So if I'm correct on Java's meaning of static here. The two getenv APIs are
functionally equivalent: a function called getenv passing the address of a sting
called name and saving the result to the memory location of a character array.
Virtually identical functions in two different APIs. I don't think Oracle can
claim to have created this particular API, and they certainly have no right to
claim copyright on it. Clearly the C++ version predates it. Not invented here.
I'll now dig for a while before posting anymore.
Feel free to offer corrections to anything I said.
[ Reply to This | Parent | # ]
|
|
|
|
|