Even the best were beginners once: We asked long-time Java experts to share their experience and tips to find out what they wish they had known before beginning their Java careers. With Java having been in business for over 25 years now, let’s hear what the professionals had to say.
Tip 1: Learn how to learn
With continuous updates and new releases, there is no end to learning Java. But you have to begin somewhere. Use your research skills to lay a solid foundation and build up a collection of sources to draw information from. This will give you a scalable and repeatable way to learn and keep up to date.
‘I wish I knew how much of my success would be dependent on being able to research effectively. When I graduated from college, I was used to all the information and requirements being outlined clearly and handed to me. I wasn't used to utilizing different avenues to learn and research. As I worked on bigger and more complex projects, I realized how important it was to utilize a variety of resources. A lot more of my job is spent reading, searching and understanding existing code more than writing code myself.’ - Dalia Sheasha
It’s unlikely that you’ll get to write your own code from scratch every time you enter a new project. Additionally, you might jump into the project when most of the code has already been written–perhaps even using a technology stack you are not familiar with.
‘So, it's important to build those skills. I also realized I needed to be comfortable constantly learning new concepts/tech. I always recommend folks try different methods for learning and seeing what works best for them - whether it's learning by video, blogs, etc.’ - Dalia Sheasha
Dalia Abo Sheasha is a developer advocate at JetBrains, the company behind IntelliJ IDEA and Kotlin, who is passionate about helping Java developers adopt newer Java releases. You can follow her on Twitter @DaliaShea and browse her website daliashea.com/ for talks and tutorials where she shares her deep expertise on Java and Jakarta EE application development.
Tip 2: Google is your friend
There is an ever-growing and seemingly endless number of libraries, new tools and APIs available for Java developers. There’s no point in trying to memorize it all. A better option is to note where the information is located so that you can find it when you need it.
‘You don’t need to walk around with the Java libraries inside your head. You don’t need to know which data structure and algorithm to use immediately. You don’t need to remember the exact syntax for your code construct.
All of these things can be found online. Your Google-fu is your secret weapon here. Don’t underestimate how important this skill is. Sure, anyone can Google stuff, but being able to Google the right thing and then parse the results to just what you need is an exceptionally useful skill.
Also, senior and lead Java developers use Google too.’ - Helen Scott
Tip 3: Learn your tools
‘IDEs are incredibly powerful, but deceptively easy. You can get plenty done without necessarily knowing a lot about your IDE, and that’s great. However, you can take your skill to the next level by learning what tasks the IDE can handle for you, thus freeing you up for the more communicative and artistic part of creating some awesome Java code.’ - Helen Scott
Your programming environment is key when producing code. Most importantly, the IDE (Integrated Development Environment) that you use to create and run your code can help you do more faster. Knowing your tools enables you to utilize them to their full extent.
‘Learning those keyboard shortcuts may seem slow to start with but will pay dividends over time. Understanding your IDE environment and what’s within it as well as what it can do for you, could (well, will) save you hours, days and weeks as your career progresses. Invest in yourself and learn your IDE. It’s your friend, which will boost your productivity in numerous ways.’ - Helen Scott
Tip 4: Create more than just code
All of the Java experts that we interviewed share more than just the passion for programming: They consistently create Java-related content around their projects that in turn creates discussion from which all involved parties can learn. Creating content is your ticket to joining a community where you can receive help and in turn help others. With so many available mediums, from public events to written blogs, it’s easy to find one suitable for you.
‘Create content: I don’t mean just Java code; that’s a given. I mean blogs, videos or talks (to name but a few). Creating content is a great way to cement your knowledge and meet people in the Java community who, by the way, are exceptionally friendly and waiting to welcome you into the fold. Creating experience-based content is very valuable, not just for yourself but also for your peers. Next time you Google something and find a blog or answer on a tech forum thread, consider the value you could add by contributing similarly. Public speaking is another powerful way to grow your knowledge and Java network that I thoroughly recommend.’ - Helen Scott
Helen Scott is a Developer advocate at JetBrains with over 20 years experience in software development; gained from roles ranging from developer to product owner. You can follow her tweets at @HelenJoScott or read her website www.helenjoscott.com that is filled with technical talks and tips for every developer.
Tip 5: Write once, run everywhere
The Java Virtual Machine (or JVM) runs
.class files, which are compiled bytecode created when compiling Java apps. This enables compiled Java code to run on any platform that has the JVM installed; allowing you to run the same code across different operating systems and development devices.
Adam Bien, who has been with Java since the beginning, over 25 years ago, explains that it felt like cheating to install Java on a computer to get an application to run.
‘I started with C/C++ and was really confused about the purpose Java "Interfaces" are serving. I understood the value after examining the JDBC API. Also, the "Write Once, Run Everywhere" idea was hard to grasp at the beginning. I wouldn't say I liked the idea of why we have to install Java first, then the actual application. I remember it felt like cheating. - Adam Bien
This approach has grown significantly more important with the polarization of mobile and desktop browsers, and Java running everything from video games, big data management dashboards, to automatic coffee brewers on billions of computers. You save time and money, and get a wider reach for your software with the JVM. Understanding the JVM is key to making your applications achieve their full potential.
‘However: high productivity and the vast ecosystem quickly paid off. I became a true Java enthusiast over the years. It would be fun to retake a look at C++ and compare it with the Java experience right now.’ - Adam Bien
Adam Bien is the author of several Java-related books and was selected as the Java programmer of the year in 2010. You can find a collection of his work in his blog, follow him on Twitter @AdamBien or sign up for his next virtual workshop at https://airhacks.live/.
Tip 6: Maintain proper naming conventions
Probably something most programmers have experienced at some point; beginning work on someone else’s app and having no idea what does what - or worse still - returning to your own app after a while and experiencing the same. Either way, clear naming conventions, comprehensive commenting, and sticking to best practises may save you, or someone else, a lot of headaches.
‘The best advice you can give to a junior developer is to use clear names for different variables to keep the code readable even without thorough commenting. Do not name your variables “A”, “B” and “C”, for example.’ - Ajelandro Duarte
This tip is worth keeping in mind even when messing about on a personal project, even if only to develop the habit.
Alejandro Duarte is no stranger to the Vaadin community: He’s a software engineer, working as a developer advocate here at Vaadin, published author, and the popular face behind many of our video tutorials. You can catch him tweeting about Vaadin updates @alejandro_du or in the weekly Vaadin Tips video series.
A tip from the author
Java is constantly evolving, with new features being released and new software running on it. This phenomenon also spawns new resource centers for you to learn from. As several of our experts mentioned, consuming and contributing content to and from these centers benefits both the individual developer and the community as a whole.
Since you’re reading this blog post, chances are you already have a collection of online resources. Still, I’d recommend at least checking out https://foojay.io/, which is a new and free platform with data and resources for Java beginners and professionals alike. You can read what Java experts, Matt Raible and Geertjan Wielenga, had to say about Foojay in our previous post.
Any questions? Ask away by commenting below!
And I’d love to hear if you have any tips for Java beginners.