Top Tips To Know When Learning To Program

So, you've decided that you want to add a particular programming language to your repertoire. Now what?

In this article, I outline 12 suggestions for study techniques. Remember that everybody learns differently. Some of these techniques may work excellently for you, whereas others may not meet your needs at all. If you start to feel stuck with one strategy, try another and see where it gets you.

Compare it to similar languages.

As you watch your first tutorials about a language or read code in it for the first time, try to guess what each part of the language will do and check whether you were correct.

Read the language's official documentation.

If you prefer to absorb a lot of information before jumping into using it, you might benefit from reading the language's reference materials. Don't worry if they put you to sleep, though reference docs are generally written to be searched through rather than memorized.

Search the web.

Searching the web is a great way to turn up information on specific errors and general best practices. When you get an error message, search for part of it that looks unique to this error but not unique to your code.

Engage with the community for support.

Although blog posts and news articles have plenty of generally useful information, there are always subtleties to the particular piece of code that you're trying to write. Don't be afraid to post to a mailing list or join an IRC or slack channel to ask for help.

Write toy programs.

To practice one new concept at a time, few tasks beat writing a toy program that uses only that concept. You can focus on getting your code as clean and idiomatic as possible. If you solve a Project Euler or Rosetta Code puzzle as a toy program, you can often compare your solution to those written by others for the same problem in the same language.

Write production-ready code in the language.

Although toy programs are a great first step, using a language in a more realistic setting can help you explore its real-life advantages and challenges. Consider porting a familiar, relatively small, well-tested program into your new language to explore its applications to real life.

Read a book about the language.

If there are several books available, compare their reviews, and also consider which author's background is most similar to your own. Many ebooks are available free online.

Watch lectures and courses.

If your language is taught in an online course, the videos might be publicly available. In addition to academic lectures, consider looking for recorded workshops, conference talks, and podcasts about the language. Putting on a talk about your new language when you would otherwise just be watching TV is a great way to slip studying into your daily routine.

Read example code.

Most books on programming languages will include code snippets. You can also find example code in blogs and on Rosetta Code. Run the code examples, modify them, and try to predict what behaviors the modifications will cause.

Read production code.

One way to find projects of all shapes and sizes in your language is to search for it on GitHub. Sort by the most-forked or most-starred repos, and your top few hits will include the language's most popular open-source tools. If you're trying to understand an open source project's design, it can be helpful to engage with their community on mailing lists or IRC. And you might even find some bugs while you're at it.

Find good tools.

As you work with a new language, ask its more experienced users about their development environments. You might find that one particular text editor or IDE has universally better support for the new language than the one that you use out of habit. Investigate what options exist for managing dependencies, formatting, fuzzing, and unit testing code in your new language's ecosystem.

Maintain your enthusiasm.

Getting started with a new language is easy, but becoming truly proficient at it is often a journey that takes years. Celebrate your successes along the way, and share what you've learned with the learners who are following in your footsteps, to keep the hobby of studying programming from turning into a chore.