Getting the motivation
Perhaps the hardest part in learning anything is first getting the motivation to start. Before you even open a book, enroll in a course, or pull up a YouTube video, you need to ask yourself why you want to learn Java at all.- Is it for the promise of job opportunities? Web development is incredibly popular right now, and you’d likely discover just as many opportunities there. Why Java specifically?
- Is it because you hear it’s one of the most popular languages out there? Well, yes, it might be the biggest programming language out there. But there’s also C#, Kotlin if you’re interested in mobile development, and Python if you’re looking to get involved in AI.
What motivated me
I jumped around several languages, from C#, C++, Python, and almost Rust, before I found Java again thanks to our Object-Oriented Programming course last year, in my 2nd year of college. This alone gave me a reason to come back to Java. It was then I realized that I loved the idea of building maintainable software, which I’m sure you’ll find is one of the core promises of the Java SE platform. I started thinking that I didn’t want to just write code, I wanted to make them last for long, and in such a way that fellow developers could easily pick it apart. That’s not to say you can’t build maintainable software in other programming languages. In fact, you might find sometimes that it has a few big limitations when it’s put up against native programming languages like C, C++, and Rust (See State of Valhalla, Part 1: The Road to Valhalla).What I love about Java
The special thing I saw in Java was how everything just made sense. Yes, it’s verbose, but I think that’s part of what makes it special: it doesn’t try to bury everything in syntactic sugar. I love this part about Java because I think that—somewhat counterintuitively—it lessens cognitive overhead while reading and writing code. I just find myself being able to read and write more code without having to decipher new syntax constantly. Apart from that, there are also many APIs. The sheer breadth and depth of the Java Platform, SE API is immense. From file IO withjava.nio, concurrency with java.util.concurrent, and a nice way to handle and transform data with the Stream API, you can do a lot in Java without needing to rely on external libraries.
All of these APIs are also incredibly stable once they’ve been finalized. These APIs are subject to a lot of scrutiny before they are declared good for production, and it really shows with the experience they provide.
Choosing your learning materials
Here comes the next hardest part because it really depends on how you learn best. Choose wrong, and it might end up shattering your motivation.Primary resources (OOP and architecture)
The very first thing you need to understand is what Object-Oriented Programming is even for. There’s only one video I can recommend for this. You don’t need any other video to understand the four pillars of OOP:
Once you know that, you can start with your primary resources on Java to know how these are applied.
Joshua Bloch’s Effective Java (3rd Ed.) is largely considered to be the best resource out there for writing good Java code. This is another resource that you should read after some time getting comfortable with Java and OOP.
Primary resources (Java-specific)
Since I’ve already had some experience programming, and I felt confident enough that I didn’t need to go revisit all the basics of computing, I chose the book by Cay S. Horstmann, Core Java for the Impatient, 4th Edition. This book was amazing for me because it cut a massive amount of fluff and allowed me to see what I could do with Java rapidly. This, in turn, allowed me to experiment with them in my own toy projects quickly. If you want something more in-depth, then Horstmann’s Core Java is for you. If you don’t feel comfortable enough with programming yet, or if you don’t like reading, then perhaps MOOC.fi’s Java Programming I & II course is for you. It’s highly regarded as one of the best Java courses out there.Secondary resources (talks/conferences)
If you also want to catch up on Java’s latest like I do, there’s no place better for that than Java’s own YouTube channel, where they host recordings of talks from JavaOne and the JVM Language Summit. There are also:- Migration guides, usually with the hashtag #RoadToXX, where XX is the Java version. For example, #RoadTo25.
- Feature deep-dives in their JEP cafe playlist.
- Short and entertaining updates with the Inside Java newscast.
Secondary resources (present Java APIs/features)
Apart from books and talks, I also supplemented it with lots of videos from YouTube channels such as Will Tollefson and Coding with John. I have to say, if you’re interested in more powerful (and perhaps advanced) features, Will Tollefson provides more videos for that. I must warn you not to make these videos a primary resource. Sometimes, they leave out details or even make a few mistakes. Whenever you’re unsure about something and want more detail, it’s best to either consult your primary resource (a book) or look up the official Java talk/documentation for that topic.Going beyond your learning resources
The most dangerous thing you can fall into is tutorial hell.