|
Val's Blog
Lots of stuff for Web 2.0 freaks and Javaholics
|
|
|
Alan Kay: "90% of code written today is getting around other people's mistakes." |
[ Login ] |
|
While the advantages of annotating the code (JSR 175 - Metadata Facility for Java) are somewhat clear to me, I have been wondering what the drawbacks could be. I don't deny that being able to specify auxiliary information for classes, interfaces, fields and methods is a good thing. What I question is the means we will supposedly use to achieve this, namely, we will be putting the whole stuff directly within the code. If not used with care, annotations could (and most certainly will) massively contribute to code pollution as legitimately pointed out in James Strachan's web log this morning. James also mentions that future IDEs should be made more clever and handle most of these boring details for us. For the most geekish of us, I can also imagine a functionality where we can define the granularity of the details we want to see in the code and then use some sort of slider control to zoom in/out the code details. Yesterday, the Eclipse community announced that code folding has been added to their IDE. Great!! I see this as a first step towards removing visual clutter in a selective and temporary way. Although, much more will have to be done in order to allow developers to use their eye power more efficiently. Actually, the problematic is quite simple: we want to get rid of the many different documents that describe some aspects (not necessarly meant in the AOP sense) of the same concepts and put everything together at one central place, namely in the code. That way, it seems to be less likely that we forget something when we have to do some changes. While this is questionable, I don't doubt in the expressive power of annotations. What I fear is that this expressiveness could be used (inadvertantly) in a way that ends up not being beneficial to developers, thus defeating one of the primary goals it way initially intended to attain. This pretty much goes in the same direction as mentioned in my previous blog, namely that current tools will have to be considerably improved to successfully address problems such as this one in the future.
TrackBacks[0]
Comments[2]
Posted by val on May 14, 2004 1:19:00 PM CEST
Reply |
Permalink
Re: The annotation hell syndrom
Without reading this, I posted about the the same thing today.
I agree. I am a little scared baggage this will bring.
Comment from Matthew Payne on May 14, 2004 3:36:54 PM CEST
I had pretty much the same apprehension when I read about the feature in the Tiger beta docs.
Seems to me just another means to add things to a codefile that shouldn't be in there but either in the documentation or in a separate class.
Much as Bruce Eckel's adding unit tests inside Javadoc blocks which he then generates source from instead of building them as separate classes...
Comment from Jeroen Wenting on May 17, 2004 8:28:05 AM CEST
TrackBack to http://radio.javaranch.com/val/addTrackBack.action?entry=1084533540000
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Content © Val | Powered by Pebble 1.9.1 |