How to Learn Programming Languages
Have you tried to code?
Deep Knowledge of Maths
In order to be a good programmer, you should know maths very well. All programming languages are based on mathematics, so if you are not a good mathematician, probably you will not be a good programmer as well. You may not always need complicated formulas (most of the time you need simple ones) in your programs, but you have to have logical thinking. Without it, you will not be able to understand how computers run programs. Basically, logic is maths, maths is programming, so all those things are closely related to each other.
From my own experience I can say that my friends, who are good and maybe talented at maths, tend to learn programming languages much faster and easier than those who do not feel comfortable about mathematics. All in all, please bear in mind - maths is a basis of programming.
Maths Is Important
Practice... A Lot of Practice!
Once you decided to start programming, you have to practice a lot. Learn by doing - there is no other way to become a perfect programmer. You can read a lot of books about programming, know all the theory, analyze many programs written by other people, but that does not help as much as practice. Why? Well, you can become a good basketball player if and only if you play a lot on the court. You will not become if you read books such as How to Become a Good Basketball Player?. But do not think that you do not need theory at all - you have to learn it, otherwise, you will not know anything about syntax, punctuation, etc. in that programming language.Nevertheless, I just want to emphasize that practice is more important than theory. I would say that practice contributes to 80% and theory - 20% of your success in programming.
Actually, I like how we learn programming in university - first of all, we have a lecture where new terms and topics are presented, and then we have a couple of practicals where we are given a few tasks associated with the previous topic and we have to solve them. In my opinion, this is one of the best ways to learn programming.
Have a Lot of Practice!
Ask for Help
If you have faced difficulties that you cannot solve, do not be shy and ask for a help. There is a great forum where are a lot of fantastic programmers, namely Stack Overflow. However, do not hurry to do that - firstly, try to solve a problem by yourself and only if you cannot find any way out and do not understand what is going on, ask for help. When asking for help, be concrete - tell exactly what part of program you do not understand. I am sure that those guys in Stack Oveflow will help you.
Start from Easy Languages
Do not start from sophisticated languages which are used in real life. Usually, they are most complicated and tough to learn. I would strongly recommend to start from C. This is quite a simple programming language, easy to learn (if you put enough effort). Moreover, it is not going to be difficult to learn other languages once you know C because it is said that C is a mother of all programming languages.
In addition to this, I would like to recommend you to learn your first language step-by-step, do not jump too far ahead. I mean that start with the easiest topics (for example, printf and scanf functions if you are studying C) and once you understand everything about that topic, go further. If you learn this way, programming might seem not so hard and complicated as others say. However, if you start studying with, let's say, arrays, probably you will not understand it and because of that you will lose motivation. Finally, you will give up and your mission to learn programming will be completed unsuccessfully.
Divide Problem Into Sub-problems
If you already have a good knowledge of any programming language and want continue to improve, this is really good advice. There are some problems which would be extremely tough and hard to solve with one huge algorithm. Then it is useful to divide that algorithm into smaller algorithms and combining them together, create a good program that executes perfectly and is easy to read for other people as well!
Example. Suppose you have to calculate the area of some figure which consists of a square and two circles (see picture below). Of course, that would be complicated and difficult to find a formula that counts the area of this figure. Instead of that, you could divide this figure into two circles and a square, easily count each of these areas and then simply add them. This is not a hard example, but I just wanted to give you an idea how you can simplify any task.
Codeacademy - Great Tool for Learning
If you find it really difficult to learn a programming language, use Codeacademy. It is an interactive platform that offers free programming classes! You can learn 5 programming languages:
What is more, you can learn markup languages (HTML and CSS) as well! So, Codeacademy is very useful and helps to learn what you want. The only disadvantage is that there is no C or C++ in this platform which are easier than those listed above.
Personally, I have been studying HTML with the help of Codeacademy. In my view, this is excellent tool. It explains everything so neatly and explicitly that there are no questions. HTML looks so easy for me now!
Khan Academy - Another Awesome Way to Learn!
Khan Academy is very similar to Codeacademy, but the only difference is that it provides a larger scope of subjects - as it is stated in their official website, they can help you learn Math, science, computer programming, history, art, economics, and more. In this website, lessons are produced in the form of YouTube videos. Topics are presented and explained clearly and in a good way. You can feel like in a lecture!
I used this website a few months ago, when I had some problems with maths, and I can assure you - this helped me so much! After watching a few videos, I got the idea of that topic and it became clear to me.
Salman Khan's (founder of Khan Academy) Talk at TED
All in All...
To take everything into account, in order to become a good programmer, you should:
- Have a good knowledge of maths. If you do not, study it! It is never too late to do this.
- Practice a lot. Learn by doing. Remember - no practice means no success.
- Ask for help. Firstly, try to solve a problem by your own efforts and only if you have no idea what is wrong - ask.
- Start from easy languages such as C.
- Divide a complicated task into smaller problems.
- Use online interactive platforms, such as Codeacademy and Khan Academy (they are absolutely free!)