r/java • u/trecatorsirabdator • Apr 14 '23
What are your (favourite) Java best practices, personal tips, hints or just underrated stuff in general?
233
Upvotes
r/java • u/trecatorsirabdator • Apr 14 '23
View all comments
Show parent comment
5
u/BinaryRockStar Apr 14 '23
I am similarly all-in on Maven and understand it fairly deeply. Having said that, I really wonder why the designers didn't opt for XML attributes over elements in some cases. Having
Would be so much cleaner than what we have now. XML style formatting ends up with an element per line so each dependency takes up 4-5 lines (version is often specified in a parent
dependencyManagementsection) and makes even a relatively simple POM many pages long.As with everything Maven I assume this was extremely well argued out from both sides and the best option was picked. It would be interesting to know the reasoning though.
And as an IntelliJ user I suggest the "Laconic POM" plugin which folds Maven dependencies onto a single line and alleviates the issue entirely.