How to go about learning a new programming language is a common question which pops up on Stack Overflow quite frequently. If I answer any of these questions, I always have several key points regarding this topic:
- Practice. Although not completely true in all situations, “Practice makes perfect” applies to an extent here – the only way to learn and improve programming in a language after a certain point is to keep doing it.
- Do something you enjoy. I think this is the most vital part about learning or doing anything – you are more motivated to do something that you enjoy, rather than something that you have to do. So make sure that throughout the learning process you are enjoying what you are doing; you’re more likely to remember what you learn by doing this too.
- Buy a book. To me, this is the most comprehensive way of learning a new programming language, with all the ideas and pointers grouped into one place of knowledge, that (if it is a good book) will cover all the necessary points necessary for the level and detail you are studying the programming language in. Try to find a book that is recognised as a good one – reviews can often indicate this.
Engage yourself in small projects – they are ways of practicing what you have learnt that are more hands-on and fun rather than just learning language constructs or syntax. The design of your projects will also help you to use any common design patterns or paradigms of the language, which will make you become more accustomed to common ways of solving common problems.
In most languages, the documentation is a wealth of knowledge for that language, which you can use to build upon the basic concepts of the language that you have learnt thus far. It’s often worthwhile looking through it to learn more about using the language this way; for example, with Cocoa development for Mac and iPhone development, the documentation offers a wealth of resources, including:
- Class documentation, explaining what the Cocoa classes consist of, for example methods and properties associated with the class and notes about each.
- Articles about common practices of the language, such as the way to use common Cocoa classes in applications that is globally accepted and commonly used.
- General articles about the Objective-C language itself and how it works.
- Apple Human Interface Guidelines on how to present your application to make it consistent with other OS X and iPhone applications.
As you can see, the documentation is a great way to learn about the language, not only within the actual language parameters but also wider topics of application development using Cocoa, and this often applies to the documentation present with other languages, such as php.net for PHP and MSDN for Microsoft technologies.
Learning isn’t just about doing something the fastest – it is about the retention of what you learn; make sure that you are awake and alert during the learning process, as this will make it easier to remember what you are learning. Don’t use coffee or other stimuli to try to help you concentrate either – this will give you the illusion that you feel awake and taking everything you are learning in, whilst the converse is likely to be the case.