r/java • u/RevilTS • Aug 03 '25
Teach Me the Craziest, Most Useful Java Features — NOT the Basic Stuff
I want to know the WILD, INSANELY PRACTICAL, "how the hell did I not know this earlier?" kind of Java stuff that only real devs who've been through production hell know.
Like I didn't know about modules recently
388
Upvotes
View all comments
Show parent comment
2
u/agentoutlier Aug 03 '25
There are so many levels of macro that you really can’t say they are overall better.
I can only assume you mean at the level of Scala, Lisp or Rust.
Macros are inherently more complex and less safe than annotations. I have gotten confused many times with scheme macros and it is one of the languages with better support.
So if annotations can solve the problem and they often can they can be a better solution than pulling out a rocket launcher that changes evaluation order.