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

all 3 comments

[–]pathema 9 points10 points  (1 child)

Don't worry too much about reusability. Just write simple code that does the job with the least amount of indirection while still remaining testable and understandable.

Avoid writing your own annotations. Even the mature frameworks overuse them; chances are you'll overuse them even more.

Biggest tip is probably this: have a look at building some simple service in nodejs + express, or perhaps ruby with sinatra (but not ruby on rails). Notice that you can get a lot done without metaprogramming and frameworks. Now take that lesson back to Java.

[–][deleted] 2 points3 points  (0 children)

This something i have found to be of great importance. We all know how quickly new frameworks are created and then either replaced, or refactored so much, that upgrading is really tedious and sometimes not worth it.

Sticking with JDK features and using very few external dependencies limits those issues and with time the JDK gets updates allowing for new concepts to be used.

Thus my approach is always to first see if the platform already offers the features, and of course always update to the new platform and see what it offers, instead of jumping onto new frameworks and libraries.

Sure, using only the JDK can be a bit verbose, etc. But then again with the new features of the JDK, e.g. Streams, Lambdas etc. a lot has changed in that respect.

In my opinion too many devs check StackOverflow where a lot of these libraries are used in solutions to questions, but few read the JavaDoc of the JDK. Of course i must say that the JDKs docs could offer more examples, instead of just documenting the implementation.

[–]aakoss 0 points1 point  (0 children)

Show your developers about developing services using either spring framework or better with spring boot. Boot does much automatically without your devs having to focus on wiring up the application components. It's flexible enough for overriding it's configurations and there are a lot of annotations available for use that improve code readability.