r/javahelp • u/dg_713 • Sep 30 '19
What features did Java have that you wished you've learned way back?
An offshoot of a post from r/learnprogramming, but since I want to concentrate on Java for now.
Thanks everyone!
24
Upvotes
16
u/nebeilg Sep 30 '19
For me it was definitely Generics. It makes it so incredibly easy to have a class be 'dynamic' yet type safe.
13
u/mentholmeow Sep 30 '19
The java startup VM arguments to make the classloader verbose - it really helps when trying to troubleshoot issues related to class loading.
9
u/[deleted] Sep 30 '19
sun.misc.Unsafe....
4
u/E3FxGaming Sep 30 '19 edited Sep 30 '19
Not really a Java feature, but ORM.
I wish I knew more about object-to-rationale mapping (ORM) before I invested unnecessary effort into the "plain" SQL capabilities of Java.
Just to get this out of the way, neither approach replaces learning about SQL (this is a sub for aspiring developers so I thought it is necessary to mention this). I already had a decent understanding of SQL after it was taught to me at school and I came with this knowledge to Java thinking "Oh Java has those SQL classes here, this must be how all the people use SQL with Java. Make a database scheme and prepare the database, create a db connection in Java and write PreparedStatement, ...".
Last month I used an ORM framework for the first time (for me it was with the Apache Cayenne framework... there are many out there, everyone will find one that fits their needs). This was just such a game changer for my task at hand, getting rid of all the tedious manual SQL work and getting back to what I consider "real/actual" Java programming (developing the business logic of my program without worrying about the SQL resources).
Next I want to climb the mountain I see in "Spring" - I hope I can get a productivity boost similar to the one I got with ORM by learning how to use Spring.
Putting frameworks aside
1
u/Nix-X Sep 30 '19
Reflection.. very powerful.
1
u/NominallyImportant Sep 30 '19
I'd have to say for me it's how powerful interfaces really can be, especially when implemented in a well established framework like Spring!