Live data from Hacker News

Java Annotations

whyjavasucks.com

1–10 of 23 posts

Re: Java Annotations

#3
Comparing Java and .NET is unfair. Java was created in the 90's. .NET is way younger than that. .NET was created with Java in mind, and of course it's a better language.

Each language has its strengths.

Re: Java Annotations

#5
Comparing C# and Java is so last decade. I don't use Java because of the language, but because of its enormous toolset and awesome community.

If there is something I can't do well with Java, then I have Groovy. I will most likely waste time trying to implement the same thing with C#. In fact I would probably just use Python or C instead.

Re: Java Annotations

#7
What is the point of this article? To vent about how much they dislike Java? It's clearly not to educate, as the least they could do is try researching how to do repeating annotations in JDK 8:

http://softwarecave.org/2014/05/20/repeating-annotations-in-...

And it's clear from reading the annotation documentation that null is not a valid value. It might be surprising to some developers, but it was a conscious decision made by the spec designers. It also shouldn't be a surprise to the author that Java is smart enough to forbid you to set a null value regardless of whether it was specified directly or they used a constant:

http://stackoverflow.com/questions/1178104/error-setting-a-d...

"I hate X" piece like this do nothing to advance the discussion on language features. They only add a bunch of noise and ramp up the flamewars on both sides.

Re: Java Annotations

#8
post #5

Comparing C# and Java is so last decade. I don't use Java because of the language, but because of its enormous toolset and awesome community. If there is something I can't do well with Java, then I have Groovy. I will most likely waste time trying to implement the same thing with C#. In fact I would probably just use Python or C instead.

This! I really don't know why those comparing languages fail to recognize that a language's success has got much to do with the "ecosystem" as well; tool-set, libraries and so on.

Re: Java Annotations

#9
As of Java 8, repeated annotations are allowed (and are backwards compatible). Also, Java 8 annotations now serve as the basis for Java's pluggable type systems[1].

One of the available pluggable type systems adds physical units, something that, AFAICT, is certainly not trivial even in Haskell[2].

So the author may not like the decision not to allow null values in annotation arguments, but Java annotations have actually become a very powerful tool.

[1]: http://blog.paralleluniverse.co/2014/05/01/modern-java/#adva...

[2]: http://www.haskell.org/haskellwiki/Physical_units

Re: Java Annotations

#10
post #3

Comparing Java and .NET is unfair. Java was created in the 90's. .NET is way younger than that. .NET was created with Java in mind, and of course it's a better language. Each language has its strengths.

.NET was originally supposed to be an embrace... extend... extinguish strategy by Microsoft on Java wasn't it? I seem to remember when .NET first came out people saying that you could almost copy and paste C# and Java code back and forth.
Post reply on HN