This is a short post from TheServerSide.com that I’d written way back in 2008. It was written in humor, which many who read it did not quite understand, but the point remains for those who wish to see it:
A conversation with someone highlighted yet another problem with Java, a fatal one:
Java’s lack of semantic awareness. Without this, coders are unable to use examples from the web, lessening whether Java is actually usable or not. Here’s a representative sample of the conversation:
Person1> What I want is x.contains(y). Person2> That's the method name that the Collections API provides, though, and it does exactly what you say you want. Person1> But my collection isn't named 'x'!
This is a clear example of where Java, had it understood that when the first person said ‘
x.contains(y)‘, he meant to use his collection name, would have been able to compile and execute the code properly.
He would have been able to find an example on the web using
contains() and cut and paste it, et voíla! Executing code. Java needs semantic awareness. Without it it will die.
I’m reposting the original content here to preserve it for posterity.
The problem doesn’t go away, though: today, someone else did the same thing.
Person1> questions.get((int) spinner.getValue()) = new Question(); tells me left hand must be a variable Person2> You want put() then Person2> or set, whichever Person1> because it is an ArrayList? Person2> because it's an OBJECT. Person1> shut up. You just said nonsense saying to use .put() on an ArrayList