How to learn programming?

Programming is a field with a high pace of changes – in spite of the fact that hardware development is slowing down, programmers are outdoing each other in new ways to make their codes better, faster and simpler. As it was said by the American writer and futurist Alvin Toffler:

“The illiterate of the 21st century will not be those who cannot read and write, but those who cannot learn, unlearn, and relearn.”

That is not exactly true everywhere, but it is not up for debate when comes to programming – the race of technologies continues to give us new ways of doing old things. Especially for young developers, it is easy to get lost in a tangle of tools, languages, and frameworks. The mass of information can be daunting and it’s easy to waste a lot of time on learning something that later appears to be useless, so in order to make things a little bit easier and clearer, I collected some useful tips and hints – not only about programming itself but also about getting the most from your mind and doing it in a healthy way.

1. Learn basics first

The general programming concepts (like loops, variables, objects etc.) are basically the same in most languages. That is the reason why an experienced programmer can learn a new technology really fast. Most parts of it are already behind him, he just has to learn things specific to the particular technology, e.g. syntax or methods names. But it is not everything – many people bypass the real foundations of programming: the logic. You simply cannot do it the right way if you cannot think and deduce. After that, when you proceed to the bases of programming, I would suggest to do it in some strongly typed language, like C++. Things may not be easier, but clearer for sure.

2. Learn how memory works and make use of it

Science says that it is better to learn 1h/day than once a week for 7 hours. That’s because your brain needs suitable intervals to keep information for such a long time. The longer the intervals are, the longer data stays in one’s memory, so if you think seriously about learning something, a long night with books is probably not the best idea. Also, the easiest way to memorize is to collect information by practice. I wouldn’t suggest you not to read, but keep the right proportion and focus more on practicing.

3. Use the tools you have

Programmers love to make their work easier, so when they create an IDE, they make sure that it has a proper amount of keyboard shortcuts. And I am not trying to advise you to learn every one of them, but when you use some functionality often – make sure it has one. What is even more important, use a debugger – you will save thousands of hours by simply adding breakpoints and checking the variables values. Also, remember to use comments. Some people say that the proper names of variables and methods are enough for the code to be readable. In many cases they are, but sometimes it’s simply not enough. So follow that rule, and do not leave a variable named ‘justTestingSmthing’, but also don’t forget to comment when it could be helpful. When you write a code, things may look obvious, but after weeks or months – it’s not always like that, even for the writer himself.

4. Take care of yourself

Your brain works best when you are fresh. The more exhausted you are, the more productivity fails, so make sure you keep yourself rested. Staying late at night might feel like doing more, but the next morning, your low efficiency can result in doing less. Moreover, repeating these nights might deregulate your body’s day cycle, so when you can, always get enough sleep. Also eat well and exercise daily – without a balanced diet and movement, your mind will never be fully sharp and healthy.

5. Divide big problems into many small ones

Not only will you amplify analytical thinking, but the code structure will be more transparent. Also, this is the way you will work with other people – you will get to do one of many tasks at a time. And it will help to build object-oriented programs instead of procedural – of course, if you’re targeting technology allowing it, not C for instance.

6. Your attitude is important

It helps to find a purpose in what you are doing. Otherwise, there is a high risk that you’ll always have more important things to do or simply procrastinate. Even if you won’t, having a clear target helps to concentrate and collect energy.
For one the target can be the money, for another – writing the code itself could be the best thing to do. It does not matter what is yours, but finding it will surely help you focus and progress.

7. Seek as many sources as you can

Watching youtube tutorials and using Stack Overflow may be tempting but this is not the way. You may get a quick imtroduction to the technology, but if you want to get some real knowledge, I would recommend to read books, documentations, discover libraries, or talk to more experienced colleagues. Also practice as much as you can – if you have no idea what to write, you can help yourself with pages like codewars. But you should make some bigger projects too – even a simple calculator or a console game – this way you will solve a lot of problems you don’t even suppose exist. And never just copypaste a code – play with it and understand it.

Obviously, nothing new was told here, but I hope that you found something valuable for yourself.
It’s good to remember that there are no versatile ways of learning. The very best thing you can do is listen to your inner voice and observe your own body and reactions in an effort to understand what’s best for yourself.

Articles chosen for you:

Share the article with your friends!

Written by:

Mateusz Tadeja

Junior front-end developer who remembers how it used to be at the beginning. Patient, motivated and hard-working.