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
- Installation was a breeze using ASDF.
- Startup time is no issue (to me).
- 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:
- “When would I use static, public?”
- “What is a bean and is this class a bean?”
(#JuniorForever, am I right?)
The Java Experience
Despite some initial hurdles, I found the experience quite pleasant:
- With Copilot as my rubber duck / passive colleague, I got the code to compile and run.
- Types were challenging at first, but I adapted quickly.
- I really enjoyed working with the Stream API.
- 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 ➡️