4 ms·
and I pointed out the headaches they caused me. I'm not really sure what point you are trying to make.
by jshen 15y ago
and I pointed out the headaches they caused me. I'm not really sure what point you are trying to make.
- latchkey 15y agoConflicts in any piece of software are a pain in the butt. That is part of software development though. You say you aren't a big fan of 'heavy use of annotations' but you don't qualify what 'heavy' is so I am guessing that it is pretty much all annotations. How do you make your determination of what annotations are 'ok' and what annotations aren't? Or do you say something like 'oh, I won't use that annotation because it might blow up on me at some later date'? What is your mental process there? Is @GET good or is @POST bad? What about @Inject or @JsonProperty? The 'annotations leave a bad taste in my mouth' statement seems kind of odd to me. Generally, a language feature isn't something that I'm careful about avoiding. I could see making a statement like "I tried to use software product XYZ and it was so full of bugs that I switched to software product ABC." But annotations aren't a software product, they are a language feature that products can take advantage of. It just happens to be that two products you were using had conflicting annotations. No big deal, you still have choices as you can just swap out products. That in itself doesn't make the functionality that annotations provide taste bad. I've met people who have had this view of annotations as being some magical creature. They didn't understand them or how they worked at all. They stuck it in their heads that 'annotations are bad', so we aren't going to use them and aren't going to even bother learning how they might help us. Everything was very black and white. I found this behavior really odd because everything in software development is grey.
- jshen 15y ago"You say you aren't a big fan of 'heavy use of annotations' but you don't qualify what 'heavy' is so I am guessing that it is pretty much all annotations." The problem is that guice is using these annotations to wire things together, but so was jax-rs. It's been over a year so I don't remember the exact problem I was having, but the short version is that annotations don't compose well and when two different frameworks require you to place annotations on the same class/method, and then they conflict with one another, it because very hard to fix. This aligns with my feelings: http://www.nofluffjuststuff.com/blog/brian_gilstrap/2010/02/java_annotations_have_become_pixie_dust http://www.nofluffjuststuff.com/blog/brian_gilstrap/2010/02/...
- latchkey 15y agoThat 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.
- jshen 15y agoMy 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.
- latchkey 15y agoI 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.
- VMG 15y ago> 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.
- jsnell 15y agoThere are many features in many languages that look superficially benign (that's why they were added to the language in the first place), but that turn out to be so much trouble that people actively steer away from them. Some are just hard to use correctly, and will blow up in your face in unexpected ways. Others are impossible for a non-expert to use at all, and will make it much harder for others to work on the code. Some will have such awful tool support that using the feature is just to painful. Yet others will work fine in toy programs, but just won't scale to large programs. It'd be silly to not dislike these features just because somebody thought that they would be a good idea, without being fully prescient about how the feature would be used in the wild.
- latchkey 15y agoI'm not really sure I understand your response because I can't tell if you are for or against annotations. But, I guess this begs the question... if it isn't done as annotations, what would the same functionality be? Spring's XML? Json? Just more coding?
- jsnell 15y agoI don't have an opinion on annotations either way, since the last Java I used was 1.4. I just found this idea of yours very odd: "Generally, a language feature isn't something that I'm careful about avoiding". That doesn't match my experience at all, people avoid specific language features (and with reason) all the time.
- latchkey 15y agoGot a specific example? I can't think of any that I avoid. I'm primarily in Java, CoffeeScript/JS these days. Maybe it is different for other languages? Certainly, there are language features that I don't use, because I don't need them in what I do, but that is different than purposely avoiding something.
- jsnell 15y ago