19

In chapter one of "The Pragmatic Programmer" the first learning goal is:

Learn at least one new language every year. Different languages solve the same problems in different ways. By learning several different approaches, you can help broaden your thinking and avoid getter struck in a rut. [...]

To achieve this over a career, the list of languages is likely to get quite long (particularly if you do not want to "progress" into management). Clearly the education of a programmer (or whatever form) is going to get you started with a core of commercially useful languages (the usual list from job posting: C, C++, Ruby, Python, JavaScript, C#, Java, VB, ...). Additionally a formal or informal learning programme is likely to have covered functional approaches (via something like Haskell, LISP or an ML derived language)

But once a reasonable subset of that list is learned- what's next, and why?

Richard
  • 841

8 Answers8

20

Make it interesting and spend each year writing an interpreter or compiler for your own programming language that fills up a niche you've never used a programming language for. Each year, write your next compiler/interpreter using the language you wrote the previous year.

alternative
  • 1,522
13

You should maximize the "marginal relevance", ie always venture into new areas that you are not yet strong at. Vary both the programming languages and the concepts. If you don't know any object-oriented language, try Java and some high-abstraction framework such as Hibernate. Then write some systems administration stuff in a script language such as Python or Perl. Then pick up some low-level skills in C or C++, writing high-performance multithreaded server code. If you don't know functional programming, try Haskell with some graph theory problems such as solving Peg Solitaire, etc. It's very feasible to do it so that everything you learn has immediate market value, until you hit erudite or special-purpose stuff such as object-capability security, Prolog or VHDL.

Good exercise by the way! This will teach you to think laterally and envision problems in language-agnostic terms, instead of relying on too few platform-specific techniques. For instance, once you master the similarities and differences in virtual method dispatch between C++ and Python, you'll pretty much "get it" instantly for any other language.

DomQ
  • 344
9

A language that doesn't affect the way you think about programming, is not worth knowing. - Alan Perlis

As some of the other answers have touched on, if you are learning one new language per year, the why? is to expand your capabilities as a programmer. The how? is by learning languages with distinct paradigms from those of languages you already know, and taking stock of the paradigms you already know determines what language to learn next.

What are these paradigms? The advanced book Concepts, Techniques, and Models of Computer Programming provides an excellent overview with a graphical map.

Thus, if you only know C-like imperative languages, then learning Scheme/Lisp is extremely useful. If you already know imperative and functional languages, then learning Prolog will be useful, etc.

A recent book that tries to teach multiple languages and paradigms is Seven Languages in Seven Weeks. Of course, you won't be fluent in each language after a week of study, but it does seem to provide an approachable, practitioner-oriented multi-paradigm perspective.

When you do grok another paradigm, it's truly a Zen moment; going from imperative to functional programming made me see the world of computing in an entirely new light. Happy learning!

limist
  • 4,656
9

C - as the essential, "underlies everything", systems programming language

Lisp (Scheme)- the strange but incredibly powerful ur-language that great hackers think defines cool

Smalltalk - because this is what OO was meant to be

Erlang (or other Actor language) to understand Actors

Haskell - to understand Monads

Javascript - because its everywhere and essential for scripting the browser

One of Python / Ruby / Perl (but it really doesn't matter which) - so you know what a popular, modern, high-level scripting language with good library support feels like

SQL - so you can talk to relational databases

Prolog - because you still need to blow your mind

interstar
  • 1,459
4
  • Go (new system level programming language with good support for concurrency and concepts not so traditional)
  • Lua (scripting language simple, expressive, extremely flexible and balanced paradigms imperative, functional and meta programming, allowing OOP)
  • D (C/C++ done right)
  • Groovy (Expressiveness and meta programming in Java world)
  • Eiffel (Design By Contract and a different approach to OOP)
  • Prolog (THE logic programming language)
Maniero
  • 10,816
2

1) Prolog: It's completely different to all the imperative languages you've been using so far, and it will change the way you think about problems

2) Lisp: without it, you might as well be using Vi

3) Erlang: Again, it's completely different, also, it seems quite fashionable.

4) Something from the Turing Tarpit (e.g. Brainfuck), and probably write a compiler or interpreter for it: I can't think of a reason to do this, but it feels like a good idea.

Paul Butcher
  • 2,817
1

While I agree it is good to learn new languages (and even imperative through a long career), I think one a year is too much past the first five-ten years. What I would rather see is someone with this level of experience learning new things about the languages they already know. At some point you need depth as well as breadth of knowledge. So you can write an If construct in 12 languages, big whoop. I'd rather see someone who really digs in and become expert in at least one thing. And then the next few years become an expert at something else. Over a 30+year career, I want someone to have depth of knowledge not just the basics in a lot of things.

HLGEM
  • 28,819
1

Besides the ones you listed,

Haskell, F#, Clojure, OCaml, Lua, Go, D, Erlang, Objective C.

Robert Harvey
  • 200,592
grokus
  • 7,528
  • 4
  • 32
  • 46