Java
Period. Full stop. End of story.
Where to start? Oh, I know where to start: Java’s insanely complicated and ugly and stupid and inherently broken generics. Need I say more? :( Ok fine, then: type erasure.
Then there’s non-deterministic resource management. Kewl feetcher!
What’s next up? Oh yeah: Java’s stupid regexes are my most irritating, seething beef. I cannot count how many times I’ve been hosed by not having enough backslashes. This is even worse than not having access to any Unicode properties from this millennium — which is complete bull. Ten fricking years out of date!!! Completely useless. Trash it.
Then there’s the bug that the character class shortcuts don’t work on non-ASCII. What a royal pain! And don’t even consider using \p{javaWhiteSpace}
; it doesn’t do the right thing with several very common Unicode whitespace code points.
Did you know there’s a \p{javaJavaIdentifierStart}
property? Whatwhatatat wereere they thinkinking? So glad they got such smart peepers wurkin on dis tough.
Ever tried to use the CANON_EQ flag? Do you know that really does, and what it doesn’t do? How about so-called “Unicode case”? A bunch of normal casing things just don’t work at all.
Then they make it hard to write maintainable regexes. Java still hasn’t figured out how to write multiline strings, so you end up writing insane things like this:
"(?= ^ [A-Z] [A-Za-z0-9\\-] + $) \n"
+ "(?! ^ .* \n"
+ " (?: ^ \\d+ $ \n"
+ " | ^ [A-Z] - [A-Z] $ \n"
+ " | Invitrogen \n"
+ " | Clontech \n"
+ " | L-L-X-X \n"
+ " | Sarstedt \n"
+ " | Roche \n"
+ " | Beckman \n"
+ " | Bayer \n"
+ " ) # end alternatives \n"
+ ") # end negated lookahead \n"
What are all those newlines? Oh, just Java stupidity. They used Perl comments, not Java comments (idiots!) which go till end of line. So if you don’t put those \n
’s there, you chop off the rest of your pattern. Duh and double duh!
Don’t use regexes in Java: you’ll just end up wanting to smash things, it’s all so painful and broken. I can’t believe people put up with this. Some don’t.
Then we can start talking about Java’s idiot nonsense with encodings. First, there’s the fact that the default platform encoding is always some lame 8-bit encoding even though Java’s charchars are Unicode. Then there’s how they don’t raise an exception on an encoding error. You’re guaranteed to get crap. Or how about this:
OutputStreamWriter(OutputStream out)
Creates an OutputStreamWriter that uses the default character encoding.
OutputStreamWriter(OutputStream out, Charset cs)
Creates an OutputStreamWriter that uses the given charset.
OutputStreamWriter(OutputStream out, CharsetEncoder enc)
Creates an OutputStreamWriter that uses the given charset encoder.
OutputStreamWriter(OutputStream out, String charsetName)
Creates an OutputStreamWriter that uses the named charset.
What’s the difference? Did you know that only one of those will raise an exception if you have an encoding error? The rest just muzzle them.
Then there’s the idiocy of Java chars not being sufficient to hold a character! What the hell are they thinking? That’s why I call them charchars. You have to write code like this if you expect it work right:
private static void say_physical(String s) {
System.out.print("U+");
for (int i = 0; i < s.length(); i++) {
System.out.printf("%X", s.codePointAt(i));
if (s.codePointAt(i) > Character.MAX_VALUE) { i++; } // UG!
if (i+1 < s.length()) { System.out.printf("."); }
}
}
And who ever thinks to do that? Next to nobody.
How many characters are there in "\uD83D\uDCA9"
? One or two? Depends on how you count them. The regex engine of course deals with logical characters, so a pattern ^.$
will succeed and a pattern ^..$
will fail. This insanity is demonstrated here:
String { U+61, "\u0061", "a" } =~ /^.$/ => matched.
String { U+61, "\u0061", "a" } =~ /^..$/ => failed.
String { U+61.61, "\u0061\u0061", "aa" } =~ /^.$/ => failed.
String { U+61.61, "\u0061\u0061", "aa" } =~ /^..$/ => matched.
String { U+DF, "\u00DF", "ß" } =~ /^.$/ => matched.
String { U+DF, "\u00DF", "ß" } =~ /^..$/ => failed.
String { U+DF.DF, "\u00DF\u00DF", "ßß" } =~ /^.$/ => failed.
String { U+DF.DF, "\u00DF\u00DF", "ßß" } =~ /^..$/ => matched.
String { U+3C3, "\u03C3", "σ" } =~ /^.$/ => matched.
String { U+3C3, "\u03C3", "σ" } =~ /^..$/ => failed.
String { U+3C3.3C3, "\u03C3\u03C3", "σσ" } =~ /^.$/ => failed.
String { U+3C3.3C3, "\u03C3\u03C3", "σσ" } =~ /^..$/ => matched.
String { U+1F4A9, "\uD83D\uDCA9", "💩" } =~ /^.$/ => matched.
String { U+1F4A9, "\uD83D\uDCA9", "💩" } =~ /^..$/ => failed.
String { U+1F4A9.1F4A9, "\uD83D\uDCA9\uD83D\uDCA9", "💩💩" } =~ /^.$/ => failed.
String { U+1F4A9.1F4A9, "\uD83D\uDCA9\uD83D\uDCA9", "💩💩" } =~ /^..$/ => matched.
That idiocy is all because you can’t write the perfectly reasonable \u1F4A9
, nor of course do you get any warning that you can’t do that. It just does the wrong thing.
Stoooopid.
While we’re at it, the whole \uXXXX
notation is congenitally brain dead. The Java preprocessor (yes, you heard me) gets at it before Java does, so you are forbidden from writing perfectly reasonable things like "\u0022"
, because by the time Java sees that, its preprocessor has turned it into """
, so you lose. Oh wait, not if it’s in a regex! So you can use "\\u0022"
just fine.
Riiiiiiiight!
Did you know there’s no way in Java to do an isatty(0)
call? You aren’t even allowed to think such thoughts. It wouldn’t be good for you.
And then there’s the whole classpath abomination.
Or the fact that there’s no way to specify the encoding of your Java source file in that same source file so you don’t lose it? Once again I demand to know: WHAT THE HELL WERE THEY THINKING‽‽‽
Stop the madness! I can’t believe people put up with this garbage. It’s a complete joke. I’d rather be a Walmart greeter than suffer the slings and arrows of outrageous Java insanity. It’s all broken, and they not only can’t fix it, they won’t fix it.
This by the same foxy-grapey people who prided themselves on a language that made it illegal to have a printf()
function. Gee, that sure worked out real well, didn’t it though!?
Sheer numbskulls. Bitch-slapping is too kind for them. If I wanted to program in assembler, I would. This is not a salvageable language. The emperor has no clothes.
We hates it. We hates it forever. Let it die die die!