Java is a popular programming language that is a choice of software developers around the world for building web, mobile, and desktop applications, websites, applets, distributed modules, games, enterprise software, cloud applications, and much more. Programmers who learn Java find many avenues opening up for them, leading to a rewarding career.
I am sharing my experience of learning Java and teaching it to my students. I hope this article will help you overcome your preconceived fear of the language by highlighting common mistakes and how to avoid them so you enjoy the process of learning.
I have been programming for decades and found that learning to code is like any other skill. So if you are not sure about how to learn Java but fully committed to acquiring this language, this article will guide you through the right learning approaches and helpful resources.
It is good to make mistakes and learn from them. However, if you want to speed up your learning, take the smart way, and learn from others’ mistakes.
Let’s see what they are.
Ironical as it may sound, learners just go through the theory and skip writing code! This never works out as you need to get your hands dirty and try out different problems in order to apply your learnings. You may have access to the best learning resources but if you are spending too much time watching tutorials and reading books without putting it to practice, your progress might be muted.
You should get down to coding as soon as you can, preferably after covering every small topic. Do not postpone it for the time when you have covered all the topics in theory.
Here are some platforms that have practice-oriented Java courses. These are especially useful for beginners who are apprehensive about taking the first steps of Java programming. There are many exercises and gam es to choose from so that you learn with a free mind, in a fun, entertaining way.
CodeGym offers an online Java programming course that is 80% based on practice. The gamification based learning journey is graded in increasing order of difficulty. There is an active online community and forums to seek help, regular articles by experienced Java programmers to harvest new ideas.
Codecademy is another online learning platform that I would highly recommend. It has interactive courses covering 12 programming languages, including Java. Whether you are a beginner or have programmed in the past, the website’s 300+ hours of Java content will help you improve. Whether you are a job-seeker, a student, or a working professional, you have the flexibility to create your own learning plan.
A product of unacademy, CodeChef helps you take your programming skills to the next level. It has practice problems sorted by difficulty levels to apply your learnings. If you want to be challenged further, participate in the coding competitions, and see test your wits against programmers from around the world. You get points and star ratings for your efforts, that is a good indicator of where you are at.
The next common mistake is when learners ignore the OOP approach in their early days of learning Java. This becomes a habit that hinders them from harnessing the full potential of concepts such as abstraction, inheritance, polymorphism, and encapsulation. Java is an OOP based language so I would strongly advise you get used to it from the beginning.
I have seen programmers who tried to get through without deep knowledge of OOP concepts, only to hit a wall of frustration when it came to solving real-world problems. It is the same as trying to play baseball with one hand tied behind your back. These concepts free you from this constraint, as you learn to see the big picture and visualize the interdependencies of your code — which objects to expose, which ones to use globally and how to interface them together?
If you try to learn Java by developing everything from scratch, you can get overwhelmed. It is important to take the smart approach and use decades of evolution Java has undergone. There are libraries with fragments of code that you can reuse to simplify seemingly complex tasks.
Here is a website with Java documentation that is commonly used by programmers like me to save time and effort. Also you can google “Java library for… “ (add your request) and you will find it with high probability. While learning to program, firstly focus on learning the language and its concepts and then try to master the libraries. And one more thing: you always can read Java classes code from your IDE.
Many learners I come across want to sprint before learning to walk. If you keep comparing yourself with other programmers your focus will waver. What makes things worse is when someone who’s been programming for a few weeks compares himself with top programmers who have been coding for decades. It is fine to be wanting to be the best but you must set realistic expectations.
We all have different learning styles and we take our own time in developing expertise. Do not let self-doubts creep in — today’s experts were beginners once who did not give up. Believe in your ability and practice regularly.
That’s kind of the opposite problem to the previous one. Executing error-free codes is an amazing feeling, whether you are a beginner or an expert. It is important not to get carried away by it and start thinking of yourself as if you know it all. Take confidence from your initial success and build on it — but never fall in the overconfidence trap.
Look at the way experts approach a problem (on such platforms as Github) and see if there’s room for improvement.
If you want to master Java programming, accept the fact that it is a marathon without a finish line. Your learning never ends but it is an enjoyable journey.
Learning programming requires teamwork. It is perfectly acceptable to ask peers for help when you are stuck. Communication is an essential aspect that would help you grow as a programmer and get honest feedback about your work.
There are many channels available to seek help. Your colleagues, teachers, classmates, seniors being the most accessible ones for personal interaction. The online world is full of communities and forums where programmers get together to exchange ideas and ask/answer questions. Some of the most popular ones are:
European Dev Explorer
In your early days of learning Java, you will hit many hurdles. Seemingly simple codes would throw errors and some of them might be trivial. Do not let emotions dictate your approach. Programming requires a logical rather than an emotional approach. The former would help you think clearly and look ahead even when everything seems to go wrong.
An error message is not a judgment on your personality, aptitude, or ability. It simply means you entered the wrong sequence of text, which can be corrected once you understand where you went wrong.
This opinion was more or less correct a few decades ago. In the past, programming was more low-level and sometimes required a mathematical and scientific approach. High-level programming using languages such as Java or Python do not require deep knowledge of mathematics for most programming tasks.
Of course, there are industries in which mathematical thinking will not be superfluous. For example, the development of game engines. Also if you want to perform complex scientific calculations and computer graphics through your programs, you do need to understand mathematics, which you can learn when required.
However for most of your tasks as Java Developer you only need logic and basic school math. So if you were not good at calculus, trigonometry, or geometry, don’t torture yourself.
Learning programming brings subtle changes in your ability on a daily basis. Each error, every wrong line of code, and incorrect syntax contribute to your progress. Mistakes are natural. Do not let them cloud your mind. Gather yourself, accept your mistake, rectify it, dust yourself up, and go at it again whenever you feel like giving up.
The worst you can do is to give up just before you are about to reap the results of your efforts.
You can excel at Java programming without having a background at coding or math. Once you choose the learning resources and dedicate regular hours towards practice, your hard work and persistence would take you places. Do not be afraid to make mistakes, seek help when required, and learn from your peers. Good luck.
First published on Dev Genius.