Starting with a new programming language?
Tags: beginners, language, learning, process
Published: 2019-08-13 18:53:12

---
title: Starting with a new programming language?
published: true
description: My technique to learn a new programming language
tags: beginner, language, learning, process
cover_image: https://thepracticaldev.s3.amazonaws.com/i/qyxeu5hi9tqv9c8brdvh.jpg
---

One of the popular recommendations that you can get when asking how to grow your skills as a software developer is to learn a new language, preferably one with a different paradigm than what you're used to. The main benefit is learning different approaches to tackle the same problem.

It's very easy to learn a new programming language. Read a few books that teach languages or the documentation behind the latter and you'll notice they follow the same pattern almost every time. That's the process I follow and to speed things I create a side project that I would implement with the language.

# Hello, World!
The obvious first step is getting my development environment ready by following the often aptly named "Getting Started" section of the learning material (More often the documentation than books, now). It can take a bit of time, but it will teach you the necessary minimum to get a program running and the ecosystem around the language. You can also get a glimpse of the latter by implementing its "Hello, World!" version.

# Syntax
Now it's time for me to learn about the syntax. As pretty much all the general programming languages follow the same set of paradigms (Imperative, Functional, Oriented Object,...), there's a lot of concepts that you can expect to be present and more often they will follow the same general behavior. Things like variables and types, arithmetic and conditional operators, branching instructions,... are pretty much the same thing in every language. Some concepts are specific to the paradigm like functions, classes,... but you usually learn them only once. I often speed read those sections and note any particular difference to what I know. I've tracked that part and it takes me less than a day to get a basic understanding of the language (Perl and Bash).

# The standard library
The experimentation begins at this stage. Now, I start working on my little project. It's usually something I already know the solution so right now, it's more about learning how to implement that using the language instead of figuring out what I need to do. If I know the paradigm, like learning C# after Java, it could be an almost literal translation. But switching paradigms will often require changing the solution details. Most of the time, the latter depends more on the standard library included with the environment rather than builtin features of the language, like mathematic operations. I learn the different modules as needed. It will take multiple projects for me to get comfortable with the standard library as you won't use its full capabilities in a single project.

# Best practices
The last step and one that takes as long as I'm using the language is the research of best practices and good techniques. I usually clone some good open-source projects implemented with the language and analyze them by using [this technique](https://dev.to/skydevht/the-code-is-a-story-1ael). Sometimes, I have a specific thing in mind that I want to learn and other times it's just because I like the project and I want to learn how it was built. Regardless of the purpose, it helps a lot with mastering the language by providing you solutions patterns that you can add to your toolbox.

And that's it. It's a process that could take years if you want to be extremely knowledgeable about the language but can take as little as a week or less if you only need to implement a specific feature in that language. The only thing I kept in mind is to deliberately practice what I learn to quickly grasp the new concepts or the difference with what I already know.