Learning a new language
Tags: programming, music, guitar, fsharp
Published: 2018-04-02 15:10:37

---
title: Learning a new language
published: true
description: My experience in learning programming languages
tags: programming, music, guitar, FSharp
---

![Music score](https://thepracticaldev.s3.amazonaws.com/i/9pi4pl0jkms1oh1j1a9k.jpg)

I try to learn or relearn a programming language every 2/3 years. In 2015 I decided to learn a functional language since I knew very little about this programming paradigm. I tried a few languages like OCaml, Haskell, Clojure and F# and finally, I decided to learn F#.

Learning a new language is a slow process, you learn the syntax and start to write some simple code in that language. In the beginning, you use the new language syntax, but you are still not coding in that language idiom. For this first stage, I usually use coding katas, because of their simplicity. I did a few katas in F# until I felt I had understood the language and its idiom, how to write tests, how to manage dependencies and how to create and build simple projects. If you are interested my F# katas are [here](https://github.com/pedromsantos/FSharpKatas).

With time you start to program in the language syntax and idiom. When I reach this point I move away from code katas and into a pet project with enough size to push me into really learning the language and the ecosystem around it. I try to choose a pet project that keeps me motivated. For F# I decided to write a music theory and guitar library I named it [Vaughan](https://github.com/pedromsantos/vaughan).

My process to select and learn a new programming language:

1. Decide on what programming paradigm I want to learn or improve
   * Some examples
     * Object-Oriented (Java, C#, ...)
     * Functional (Haskell, F#, Clojure, ...)
     * Logic (Prolog, ...)
     * Procedural (C, Pascal, ...)
     * Declarative (SQL, ...)
     * ...
2. Decide what type of applications I would like to build
   * Some examples
     * LOB applications (websites and web apps, mobile apps, enterprise applications)
     * System (web servers, operating system, network, low-level stuff :) )
3. Try a few languages that match the paradigm and the type of application
   * I usually spend a few weeks/months researching matching languages
4. Select the language and start learning it
   * Get recommendations for a starting book or other learning resource
   * Find others interested in learning with you and learn together
   * Find a mentor to guide you
     * For F# I had my friend and awesome person [Samir Talwar](https://noodlesandwich.com/) guiding me into the world of functional programming
5. Use code katas to learn the language (syntax mainly) and ecosystem fundamentals
   * Single abstraction kata examples
     * Fizzbuzz
     * LeapYear
     * Roman numerals
   * Simple multiple abstraction kata examples
     * Bowling
     * Tic tac toe
     * Game of life
     * Mars Rover
6. Build a pet project with the new language

Building [Vaughan](https://github.com/pedromsantos/vaughan/wiki/Documentation) and learning F# has been a remarkable experience. If you are interested in music and/or guitar check it out.

Before F# I learned the Swift language and scratched the surface with iOS.

At the moment I'm again in the process of selecting a language to learn. This time I decided to learn a systems language. I'm undecided between learning Rust or relearning C++ specifically the new C++11/14/17 standards. I did a lot of C++ in the 90's early 2000's but mostly forgot about it. Both languages look exciting.
I already did a few of the mentioned katas in C++ [here](https://github.com/pedromsantos/cppkatas)