Learning a new programming language can be a rewarding and profitable experience, but just like learning a spoken language, it can be a challenge to become proficient and avoid frustration and despair.
Here are some tips that will help you learn any programming language and become good at it.
Start Small and Explore
Start with the classic “Hello World” program to make sure your tools are correctly installed and configured and then work from there. Find small example programs and figure out how they work and try making some simple changes. Once you’re comfortable with the basics try something more complex.
Read The Book, But Just Skim It
It’s important to have a good book by your side to guide you on your journey. Find one which suits your style and you feel most comfortable with, because you’ll be spending a lot of time with it.
It’s not important to memorize the entire language or the standard library, but it’s valuable to get an overview of how it works and what is in it before you start using it. It’s always tempting to write in a new language using the style of your previous language, but this can cause you to fight your language unnecessarily. Get a feel for the various features of the language and the approach it takes to get things done.
Whether you use a language tutorial or a reference manual to learn, be sure to try out what you learn as you go. This will help you understand the language rather than simply memorize it.
Have a “cheat sheet” of the language syntax and features to lighten the mental load as you learn. Trying to keep exact language details in your head can get in the way of learning the important ideas being presented. A good approach is to create your own cheat sheet, but there are also many available online.
Use Free Courses
There are many excellent free online resources for learning programming languages. The most valuable of these are video courses from online learning websites and university courses.
Even if you find a course that you really like, it can be helpful looking at the same material from different courses. A different perspective can help you understand difficult concepts or give you a better insight.
Be sure to try out what you learn in each video as soon as possible so that you gain a deep and practical understanding of what you have learned.
Always be Writing
Practice makes perfect and constant practice will help you understand the language.
By learning how to write idiomatic code, or code that works like the language intended, you will become more productive because you will use the special features and advantages that the language offers.
Look at other people’s code and modify it to see examples of this and to gain ideas and inspiration for your own work.
Try contributing small but useful changes to open source projects to build your confidence in the language. Your work will be reviewed by experienced programmers before it’s accepted, and they can provide valuable feedback and advice.
If you have a browser you’ll never get stuck
Wherever you get stuck it always helps to ask an experienced colleague or teacher to get you over a hump. When you’re teaching yourself this isn’t possible, but the internet contains a wealth of information and many people have encountered the same problems as you. Just enter your problem or question into a search engine just the way you ask a person. It’s very likely that someone has asked that same question and has been given a good answer. If you don’t succeed, try asking the question a different way or simplifying it.
Never Stop Learning
Getting better at a programming language happens over time. Only through experience do you understand the philosophy of a language and build your understanding and proficiency. Also, languages tend to add features over time so it’s important to be to date with the latest information.
Try to have your own project that you like or find work to motivate you and give you a chance to practice your skills. Just like spoken languages, unless you use your skills you will lose them.
Always have a good language reference to hand and refer back to it to refine your understanding and learn the finer details of the language. Also, investigate the language’s standard library and other popular libraries to improve your productivity and expand the range of software you can write.