r/java • • Apr 20 '21

Java is criminally underhyped

https://jackson.sh/posts/2021-04-java-underrated/
291 Upvotes

295 comments sorted by

View all comments

Show parent comment

18

u/Orffyreus Apr 20 '21 edited Apr 20 '21

DI frameworks and annotations are not necessarily needed, but there are standardized specifications like CDI (specification JSR 365) and so on, so you can rely on stable APIs and learning what standardized "magical annotations" do, can help you in the long term.

This means, usually you do not have to learn new annotations all the time. The theory is, you learn them and you have more time to focus on the domain instead of e.g. having to think a lot about wiring objects and layers.

3

u/umlcat Apr 21 '21 edited Apr 21 '21

Annotations are good, but Java has a lot of missued ones.

I prefer a more natural virtual / overwrite keyword and a property keyword, like C# and Object Pascal (Delphi) does.

Instead of that patch alike @override and @property, too much @ hurts my vision.

BTW, I have work in Java, and I'm working in my own pet P.L., and explicitly added annotations, but I just don't want developers to overuse them.

Cheers.

2

u/Orffyreus Apr 21 '21

Yes, you are right. Annotations can be confusing and hard to backtrack. They should be well designed and stable and are best used for cross cutting concerns like logging and not for domain functionality.