Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That is a great blog posting.

However, I don't know why the author would even suggest that annotations are innocent looking. They aren't any more 'innocent' than an if statement. Something like: 'if (myMethod())' could easily be a long running database query or call out to a fibonacci solver. Should we all be afraid of using if statements too?

I'm sorry, but there is really nothing 'magical' about annotations. It is simply a marker on a class, property or method that other code can read from and do things with. Prior to annotations, apps were processing Javadoc (@see early versions of GWT), which was an even more terrible idea since you didn't know if it was Javadoc or an annotation.

The summary is that a) software engineering is not easy and it does involve knowing what you are doing in order for things to not appear 'magical'. b) If you are going to put an annotation on something, then you should know what code is going to read that annotation and what effects it might have. That said, that isn't the fault of the annotation language feature.



My argument is that annotations don't compose well, interact in complex ways that are hard to reason about and debug, and that this is worse than non annotation based methods used in other languages.

Your response seems to be that one needs to understand the complex interactions of annotations before using them, therefore annotations are fine.

That's a non sequitur.


I disagree with your argument. To you, they are all of those things. To me, they are great and none of those things. That is all I'm saying.


> I'm sorry, but there is really nothing 'magical' about annotations. It is simply a marker on a class, property or method that other code can read from and do things with.

That is the magic. You escape your default programming paradigm of sequential statements and start doing metaprogramming.

The reason there are annotations is that the java language wasn't capable of doing certain things without annotations. Some of us think that java shouldn't do these things.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: