Buy @ Amazon

Java Development Tools You Must Leverage For Productivity

Unlike its counter-parts like Python, Javascript or Ruby programming languages and it's ecosystem that keep evolving at frantic pace, Java and ecosystem doesn't and hasn't changed dramatically. What is more worrisome is that most of the Java teams haven't caught up with its own contemporary toolset; as case in point most of the teams are at best on Java 8 and if they were to be on higher versions, you don't see them leveraging some of its key features for profit. This post is a list of tools that I think your teams should be using for profit from developer's productivity:
  • If IDE, then IntelliJ, for it offers a incomparable list keyboard short-cuts for your productivity that spoils your natural style of programming. I further customize it to automatically truncate line-ending whitespaces, do code-folding, etc. to suite my coding style.
  • Developer-Readme.md is one of the often overlooked thing that I insist in for every single project repository with details on developer-setup instructions, project specific workflow instructions from pulling code to pushing committed code into managed code repository. Ensure it is self-explanatory for any new developer to jump-start work in no time. This is adopting Boy Scout Rule, from the word go.
  • Maven or Gradle for dependency management. Upgrade yourself from Ant, if you are still using it.
  • I have strong bias for JUnit5 for unit-testing over other options like TestNG etc. Complement it with Mockito for Mocks/Stubs/Spies to be used in your tests over its XUnit counterparts that are legacy. 
  • You would do great if you are using AssertJ for your unit test assertions. It has fluent APIs for your convenience making it more readable even for business users. Under the hoods, it does use Hamcrest internally. So in essence, it is Hamcrest with the power of user-friendly fluent APIs.
  • If you got your tests (unit, integration, etc.) segregated under different sub-directories under `test` in your maven project, as you should, Maven-Surefire plugin makes it easy in configuring it. You would want to use it for other such test configurations as well.
  • JaCoCo is a tool I had earlier used for code coverage reports along with SonarCube. It used to be easy-peasy with its Maven/Gradle plugin, but I'm having issues now in getting it to work in one of my maven projects that uses Maven-Surefire plugin, may now be a little tricky integrating with surefire plugin - you should get it working in increments of your needs.
  • SonarCube for code quality and static security analysis, is my preferred choice.
  • Apache Lombok for reducing code verbosity using its magical annotations.
  • SLF4J (Simple Logging Facade for Java) is widely used in Java services as a logging facade that abstracts the underlying logging implementation which can be changed during deployment time. Additionally, one `@SLF4J` lombok annotation at the top of your class, get's you going with using `log.debug(..)` or log.error(..)` in your methods. It supports most popular logging frameworks like Log4j2, Logback, etc.
  • OkHTTP3 is my preferred library for making HTTP or Websocket connections over the internet, whether you are coding for Android or server-side. The API is lean, fast and really simple to use. Not sure if there are even better contemporary libraries on this front.
  • I still use Jackson for data-binding between DTO and JSON, mostly because of assumed familiarity. I do want to check out if there are better and nicer alternatives.
  • If you are using binary protocol for inter-service communication, you should consider using Google's ProtoBuf without any excuse.
  • Fore REST based inter-service communications, you should consider tools like Swagger/OpenAPISpotLightTypeAPI, RAML, etc. I prefer Swagger/OpenAPI for not only it serves as fantastic tool for API documentation, it also aides creation of sandbox environment easier for enterprises.
  • If you are on Windows, you should consider Docker Desktop to launch your docker/kubernetes environments by integrating with WSL2.
You can check out how all these tools are put to use from one of my open-source projects, DhanHQ-java.

Hope you got a think or two to learn from this and put at your work.