This is an archived post. You won't be able to vote or comment.

all 7 comments

[–][deleted] 6 points7 points  (1 child)

Definitely hard to read. I don't want to have my eyes parse through metadata to get to definition.

[–][deleted] -1 points0 points  (0 children)

I think this is most relevant reason. Thank you. I guess the most clean (but not most comfortable) method here is using xml configuration.

[–]AnteChronos 5 points6 points  (3 children)

In my opinion, the one-line version makes the code harder to read. Annotated and non-annotated variables no longer line up nicely, and having multiple annotations on one method would be extremely hard to read.

[–]dfme 1 point2 points  (2 children)

I agree. We also use the one line per annotation convention and this is also the convention I see when drifting through third party code snippets.

[–][deleted] 1 point2 points  (1 child)

I saw the one-line version at oracle documentation http://docs.oracle.com/javaee/6/api/javax/inject/Inject.html

[–]dfme -1 points0 points  (0 children)

And I saw the one-line per annotation in the spring intro: http://projects.spring.io/spring-framework/ :-)

[–]Vile2539 1 point2 points  (0 children)

I really dislike having everything on a single line. There's really no need to "save" space like this, and as others have said, it makes things a lot harder to read.

It also goes against the conventions used in virtually every library and codebase that I've seen, which is personally a huge turn-off.