onsdag, februari 13, 2008

Java Annotations

I feel that a few rants are about to burst in me. Let me take this first; this is not a rant, though. Just a very large exclamation:

Java Annotations are NOT a way to implement DSLs, and will never be.

Java annotations are really nice, but seriously, they are NOT manna from heaven.

10 kommentarer:

Anonym sa...

Who said that you can build DSLs with annotations?

Anyway, annotations are one thing I'm definately missing in Ruby/Rails.

Things like before_filter :login_required, :except=>[...] are just way too error-prone IMO. I'd like to declare this kind of stuff directly where it matters: At the methods.

DSL or not, don't know. This DSL thing is becoming too much of a buzz to me anyway..

Anonym sa...

Sounds like some people are getting declarative programming (which annotations DO help with) and DSLs (which may or may not be declarative) confused.

David R. MacIver sa...

The sociology of Java annotations is interesting. As far as I can tell the Java community basically went "Oh my god! Sun actually gave us AN INTERESTING FEATURE!!!!" and, as one, went mad with delight and decided that they had to use the damn things everywhere and for everything.

Unknown sa...

Gah! Java Annotations...

They are easily as broken as Java Generics. Possibly worse. Horrible!

I'll wait for someone to ask before spilling my complete Java 5 rant all over your blog. :-)

Anonym sa...

Off topic: How is your Scala exploration going? It was a while ago you last mentioned it now...

Anonym sa...

Gah! Java Annotations...

They are easily as broken as Java Generics. Possibly worse. Horrible!

I'll wait for someone to ask before spilling my complete Java 5 rant all over your blog. :-)


Generics are horrible, but what's wrong with annotations? And I'm also interested in the rest of your Java 5 rant, so consider yourself asked :-)

Unknown sa...

Anonymous... Click on my name to reach my profile and click the Not Coding blog... I posted a draft of my thoughts there. It's too much to pollute Ola's blog comments with.

Cheers,
Clinton

Anonym sa...

Thank you Clinton, very informative! You raise some interesting points that I wasn't aware of before.
I already had the impression that Java - the language, not the platform - is declining quality wise and reading rants like yours only reinforces that impression.

Unknown sa...

Sorry, Anonymous, I didn't mean to leave you with no way to respond on my blog... :-) I posted an email address for feedback.

Clinton

Gordon DuQuesnay sa...

Recently I've been working with JBoss Seam. It uses annotations heavily. I'd really like to try using JRuby for some parts of the project, particularly testing (perhaps using jtestr) the part I can't figure out though is how to handle all the annotations.