Learn a New Language

Learn a New Language

Steve Kim

April 12, 2012

We're already a quarter into the year. Have you learned a new language yet?

In Pragmatic Programmer, one of the 70 tips is to invest regularly in your knowledge portfolio. And probably one of the most popular advice is to learn at least one new language every year. So, what language have you learned this year? If you haven't started, don't worry, there's still some time. Here are some tips to get you started.

  1. Picking Your Language

    Some of you have a personal list of languages you want to learn. Here's my personal list of languages (in alphabetical order):

    • Amber
    • BiwaScheme
    • Clojure
    • Dart
    • Elixir
    • Go
    • Mirah
    • Objective-C
    • OCaml
    • Redline Smalltalk
    • Rust
    • Self
    If you don't have a list, try picking up a language that uses a different paradigm than what you're familiar with. For instance, if you mostly develop in Java, try a functional programming language like Clojure or Scheme. If you work with languages that are mostly functional, try an object-oriented programming language like Ruby or Smalltalk or Java. You can also pick up languages based on their type. If you're familiar with dynamic typed languages, try static, and vice versa.
  2. Koans

    If the language you want to learn has a set of koans, then I highly recommend going through them. Koans are sets of unit tests that exercise the features of the language. The idea, originally by Ara Howard, became popularized when EdgeCase introduced Ruby Koans. From there on out, others have created koans for other languages.

    Here is a list of some of them:

    If no one has written koans for the language you want to learn, what better way to learn a language than by creating koans? Not only will it be a motivation to learn a language, you will also be contributing to the community by giving others the opportunity to learn the language.

  3. Building A Breakable Toy

    As described in Apprenticeship Patterns, a breakable toy is a pet project that allows you to learn in a safe environment where you're allowed to make mistakes and fail. Experience builds upon failure and success.

    If you prefer to write something other than koans, build a breakable toy. One example would be to write a Tic-Tac-Toe that has an unbeatable computer. Another would be to build a simple HTTP client. Try not to use third-party libraries and instead rely on the standard library that is provided in the language. Push it out to GitHub and let the community see your project.

  4. Contributing to Open Source Project

    Find an open source project that interests you in the language you want to learn. This gives you an opportunity to read someone else's code, looking at the style and convention. You may also pick up on language patterns that other developers use.

    Be careful when choosing a popular project. Popular != quality and may fall short of good practices, patterns, and principles.

  5. Pair Programming

    Pair with someone who has a deep understanding of the language you want to learn. You can quickly pick up on the idioms and conventions. This may be the quickest way to dive into a new language and it is to your advantage to ask many questions.

I've probably stated the obvious, but hopefully this will kickstart your getting started on learning a new language. As pragmatic programmers, as craftsmen, it's important to keep up to date with current technologies, languages, and environments. Invest in your knowledge portfolio!

Oh, if you haven't already, check out Jason Rudolph's blog post for more inspiration and motivation.