Learning to program
Learning to program means, fundamentally, two things: Learning a new language, and learning to solve problems by way of using this language. This means writing code and describing your solution to the problem.
When this text, the one that you are reading right now, was written, the author used the language English trying to come up with an adequate solution to the problem “How can someone best start learning to program?” Reading this text you also use the language English. If you think about what you are doing right now, you will notice that you do not think about English as a language at all. Right? Instead you use the language in order to figure out what this author might be talking about, and what that might mean to you.
Try to remember when you last walked up the stairs. Walking up the stairs is a pretty complex series of movements, and it took you quite a while to properly learn it as a child. The exact order and coordination of movements, bending your knees, ankles, while keeping your overall balance, is so complex that we probably wouldn’t even be able to describe it properly. However, we have somehow managed to learn this ability and we can now use it.
The point I am trying to make here is: When you last walked up the stairs you were thinking about all sorts of things. Maybe you were on the phone with someone, searching for your keys in your pockets, and thinking about looking for a nice introduction to programming online … maybe you did all of this at the same time. Whatever it was, you did not think about how exactly to bend your knees and ankles while trying to maintain your balance and get up to the next step.
Programming is very much the same. As programmers, while we program, we do not think about the programming language, and how to use it. Instead we simply use it, and meanwhile think about very different things, such as the problem we are trying to solve, how we can make things easier for fellow programmers, how to best suit the needs of our users, or customers, and so on.
When you start learning to program you will first learn about the basic concepts of the programming language. And you sometimes may feel slightly overwhelmed, and wonder how programmers might be able to remember all this stuff. The trick is: they don’t, consciously. Instead they have assimilated these concepts so much that they are able to simply use them, without consciously remembering or thinking about them. Just like you use English, or your ability to walk up the stairs.
That’s why learning a programming language, just like learning any other language, or skill, is a lot about repetition: You basically brainwash yourself into being able to form meaningful “sentences” (code) without having to think about the concepts that you are using.
Over time, while you repeat basic concepts of Ruby over and over again (by way of doing exercises and writing code) you will notice that things become very natural, and this probably will happen much quicker than you think.
At first, you will not understand anything. It’ll be weird, just like with learning any human language. You will struggle with words, and not know what symbols are what, and it’ll all be very confusing. Then one day BANG your brain will snap and you will suddenly “get it.” If you keep doing the exercises and keep trying to understand them, you will get it. from the great book Learn Ruby The Hard Way by Zed Shaw.