↖️ Show all posts

Getting my feet wet with modern Java.

Java has been getting a lot of positive attention lately, and I wanted to see what all the excitement was about. As a long-time Rubyist, I’ve been spoiled by Ruby’s vibrant community and user-friendly ecosystem. So, how would modern Java measure up?

In Uni Java felt super alien and the introduction to coding was a bit rough. So in a sense Java was the reason why I didn’t pursue becoming a software engineer. But now, with a few years of coding experience under my belt, I wanted to give it another shot.

Getting Started

  1. Installation was a breeze using ASDF.
  2. Startup time is no issue (to me).
  3. The classic “Hello World” program? Done in no time!

The Build Tool Dilemma: Maven vs Ant vs Gradle

Here’s where things got interesting. In a previous project, I had used Maven with simple commands like: mvn clean install and mvn spring-boot:run - that’s about it.

This time, after some research, I decided to try Gradle, which seemed to be the most modern option.

Diving In: A Simple Algorithm Implementation

I started with gradle init and chose the Java library option. To help me along, I used GitHub Copilot as a tutor, asking questions like:

(#JuniorForever, am I right?)

The Java Experience

Despite some initial hurdles, I found the experience quite pleasant:

  1. With Copilot as my rubber duck / passive colleague, I got the code to compile and run.
  2. Types were challenging at first, but I adapted quickly.
  3. I really enjoyed working with the Stream API.
  4. Using HashSets and HashMaps instead of creating classes for everything felt lightweight and modern.

While the keywords, syntax and types took (and will take) some getting used to, I eventually got everything working smoothly.

The Result

You can check out my first two Java projects here:

Overall, my journey into Java was a nice experience. While it has its own learning curve, I can see why it’s receiving good press. Have you tried stepping out of your programming comfort zone lately?


⬅️ Read previous Read next ➡️