So, You Want to Learn Java? Take the Next Step!
You’re probably thinking: hang on, what do you mean learn Java? We’re all successful Java developers, creating marvelous programs from sketchy specifications while drinking unreasonable amounts of coffee? Oh and being paid relatively well to do so! The truth is, you can never have too much knowledge or experience. We can always learn something new and acquire the next necessary skill that will transform our view of the world (or not, but will still be helpful at work).
In this post I’ll try to outline a self-development path that can lead you from being confident with the Java syntax to being better in any software corporation. No doubt most of you already have much more experience than this novice I’m painting a picture of. You should think of this post as an exercise in organising your mental model of what you do and the skills you possess. After all such a reflection might help you realise what you want to do next in life. You might want to think about creating a fantastic startup and become a gazillionaire overnight.
What to Learn After Java Syntax?
When you understand the syntax of a programming language and are capable of creating a small program that performs a computation, you are standing on the zeroth step of the software developer staircase of skill. Let’s look at what we need to do to climb the remaining stairs and slide down them on a tray made out of the amazement of your team.
How You Can Grow as a Developer
So, you know you’re capable of creating a program in Java and you’re ready to grow as a developer, by taking on more responsibility in your projects. What should you learn next? First of all you need to understand that industrial code is very different from your small project’s code. And more importantly, there is some sort of process (not on the code level) that specifies how your team creates software.
One of the most common qualities of any industrial code is that it will be peppered with frameworks, libraries and third party code integrations that you will need to understand and be proficient with to maintain and evolve the codebase.
Frameworks are the key. Any decent programmer can whip up a semi-decent solution to any problem. However it takes a lot of time. Standing on the shoulders of giants, or in this case, code reuse is much more important. If you’re trying to get ready for the industry, familiarize yourself with these frameworks and you’ll have a much better grasp of existing projects.
Let’s talk about Spring. Why? Well, Spring is the de-facto standard framework in the Java world. Its core value come from the dependency injection mechanism that allows you to wire the components of your system together with little configuration and boilerplate code. On top of that, the Spring framework offers you a ton of integrations with all kinds of other libraries and frameworks: templating engines, database drivers and data access frameworks, social networks integrations, authentication libraries, http clients, validation libraries and so on.
Make sure you also take time to learn Hibernate or JPA for your database access. Preferably both! The gurus will tell you that it’s irrelevant and you should be writing your own queries. However the real life truth is that object relational mapping frameworks have their place in code and knowing them will always be a big plus. If you want to learn more about SQL, look at the jOOQ library, a nice type-safe DSL for specifying your SQL queries in Java. On top of that two good choices for libraries that you will use in projects are Guava and Apache collections. You should learn about helpers, static methods for collections literals, String utils, predicates and much more. These are all utilities that you’ll often be tempted to write yourself, except they’re already prepackaged, battle tested and ready to use, so be aware of your toolset!
The database is one of the most mandatory components in any decent size system. Learn the basics of how database drivers work: the connections, how they are pooled, prepared statements and so on. Play with a relational database and one NoSQL data store (MongoDB is a safe choice for a NoSQL solution that the industry widely uses). When you’ve got all that, you’re ready for the real world to test your skills! However, if you choose to go further down the rabbit hole, you might bump into distributed computations with Hadoop or Spark. This will make you think and ponder for some time and will teach you some valuable skills.
Now we finally get to my favourite bit — the tooling! Tooling is essential and without mastering the absolute minimum, you won’t ever be able to call yourself a productive developer.
We’ll start with the IDE. Are you an Eclipse fan or a loyal IntelliJ IDEA user? Either way, learn the shortcuts, learn how to separate the configuration so you can be productive on any setup in a matter of minutes. Learning the features of your IDE can show you how the IDE developers pictured you using it. This will teach you a lot, since typically IDE developers are really smart folks. Even better, look at a few IDEs and pick your favourite based on your actual experience, rather than prejudice or peer pressure.
When you have figured out which IDE to use, spend time learning to command your build tool. Pick your single most important project and learn about the build system that powers it. Chances are, it will be either Maven or Gradle. If you have the freedom to choose, pick Gradle. It’s newer, more flexible, and the learning experience will be much more fun. You can easily learn about Maven, and its intricacies, later, if your life throws you into an enterprise project.
Java Version Control
Also, learn a couple of tricks and tips about a modern version control system, say git. You don’t necessarily have to know how to explain all possible git commands in terms of the ‘rebase’, but understanding a couple of typical workflows is important. These can include merging commits, branching appropriately, squashing commits into one and writing clear commit messages. This short list will carry you a long way.
There are many ways in which tools can help software development and you should be aware of their existence and the possibilities they offer at the very least. Static code analysis tools will help look after the quality of your code. Continuous integration servers will crunch your tests and code coverage tools will show how comprehensive your test suite is. Also, learn about profilers so you respect performance engineering and care about how swiftly your code executes.
There are even more tools that you can benefit from using, if you have a moment, check out JRebel for reloading code changes instantly during Java development and the lightweight Java profiler — XRebel, these are developed by the ZeroTurnaround team, which is us, but they are really cool, don’t miss out. And by the way, if you opted for using Eclipse, check out the Optimizer for Eclipse plugin that can boost it’s performance and enhance the experience a bit. Have no fear, IntelliJ IDEA users, you can also try optimizing your IDE by using the Optimizer for IntelliJ IDEA plugin.
If you have experience in all of the areas we’ve mentioned so far, but you don’t want to learn about them in more depth, consider turning your attention to alternate JVM languages. The JVM is one of the most capable platforms these days, so staying on top of it and current makes a lot of sense. There are all kinds of different languages that can run on the JVM, so it’s important you pick one that you’re interested in learning more about. My personal favourite is Clojure. It’s like an opinionated Lisp on the JVM. It’s dynamic, laconic and very different from Java. Don’t just take it from me though, give it a go yourself. If you’re interested in a more powerful type system and a more functional approach to code, check out Scala. Alternatively, look to Groovy if you want to have immense power at your fingertips without losing compatibility with your Java code. You’ll also reap the benefits of choosing static vs. dynamic typing whenever you need to.
Recently, we heard from the JVM programming language designers, so make some time to watch those Virtual JUG session replays as it will help you figure out which language you might want to try next!
One of the hardest things to learn, but arguably one of the most important is experience. While there are myriads of projects that use Java, it’s surprisingly hard to find something that is well-written, relevant, modern, interesting and open source. It’s important for new Java developers to refer to a reference project from which to learn.
A great recommendation for a reference project is JUnit. It’s an open source testing framework, developed partly using Test Driven Development techniques. The code base is well commented, clean and contained enough to be a great learning asset.
If you want to learn how to build a fluent nice API, take a look at jOOQ, the type-safe DSL for SQL. It’s nicely developed, fluent, meaningful and well named (since it often mirrors the SQL syntax). Basically, it’s where many API strive to be.
The last and my personal favourite toy project is zt-zip — the library for zip archive processing we developed at ZeroTurnaround. It consists just of a couple of classes plus tests. But I often find myself wondering how it would stand up to a new software approach or tool. I tried running it with Java 8 a while back, when Java 8 was just appearing on the horizon, and have more recently used it when looking at the pitest mutation test library. When you find yourself in need of a small project that is actually meaningful, give it a go.
Wow, this turned into a longer post than I expected, so I should probably stop rambling and leave you with some pointers of where you might find some more awesome information. If your preferred medium is text, then you’re reading a great technical blog about Java, well done! Make sure you subscribe to RebelLabs to read more opinionated technical posts on Java and the JVM! Another comprehensive resource, containing a great list of projects, libraries, and resources is the Awesome-Java Github repository. Check out the links to other useful blogs, twitter personalities and projects that you want to check out.
If you prefer more of a visual learning experience, maybe watching presentations and listening to the actual people if the way to go. You should look to join your local Java User Group meeting which will offer you a really great opportunity to learn and network with others, who may well be your future employers! Alternatively, or as well, you can enjoy the awesomeness of the Virtual JUG, the online only Java User Group which is just over 2 years old now. It’s extremely popular and enjoys the luxury of having the best speakers in Java community present, each month.
If you want to apply all your new found skills you’ll need a playground in which you can safely experiment. You could find an open source project to test your software development strength and try new technologies. Alternatively, if you just want to pick up a language and see how a language feels, you can find some awesome problems on the internet, like Project Euler. You’ll be tasked to solve a mathematical problem and you can use any programming language on any platform using any technology you want. This is the perfect playground for trying out new languages and more.
Look upon this post as a collection of links to the resources you should consider learning. Maybe bookmark some of the links so that the next time someone asks you how they can improve their basic programming skills, you can point them there. Naturally, your mileage may vary, and you can have other preferences to what to learn and how to grow software development skills. Please don’t get all mad and throw rotten fruit and vegetables at me! Instead share your preferred stack, tools, and skill sets in the comments below and perhaps add other areas which you think are important to learn and master -- I’d love to chat about it! In the past we’ve asked people what tools and technologies they use and compiled a list of the popular.
Hopefully this was a useful post! :) Soon, we’ll publish another which tells you how you can nail your next Java interview -- that one’s in the works right now, so be patient! This will hopefully prepare you for questions on which libraries you need to use, along with useful projects and links, while being prepared for any tricky questions they might throw at you!
If you're still getting used to Java, having a cheat sheet at your disposal can be a lifesaver.
Our Java 8 cheat sheet is one such lifesaver. Download it below.