Your First Programming Language

What programming language should you learn first? Back in University, juniors who wanted to get on the programming roller coaster often asked me this. After much deliberation, I think I have my answer. In this post I express why I think a lot of conventional wisdom here isn’t the best, and what I suggest as the first language for getting started with coding.

“What programming language should I pick up first?”

One of the better known flame wars in the world of computer programming. And one with a diversity in answers that will surprise you if you reflect on it. Some feel that a dynamically typed interpreted language is how you should start, while others see value in being used to a type system and a compiler from the get go.

You’ll often hear that you should pick up Python first, because it is among the easiest and thus is a gentle introduction to the area. Others go the opposite way and suggest C so that you learn the nitty-gritty of how stuff works. Some might even suggest Java as an alternative compiled language. A modernist may suggest Go since it is a small, easy language that is typed and compiled. Some might say, “JavaScript if you want to do web dev, Python otherwise”. You might even meet people who suggest you start with a functional language like Haskell so that you “don’t pick up bad OOP habits”.

I humbly disagree with all these people.

Every single language has trade-offs. Many exist to make up for the shortcomings of the ones that preceded them. But in the (narrow) context of a complete beginner who wants to learn how to make a computer do their bidding, I think all these languages fall short.

Python is easy, but it does too much for you. You learn too little about the internals, and moving to a different language later may become painful. C is hard. Not because it is hard to get a program to compile and run (that one is Rust), but because there is too much to do (memory management, etc), and it is too easy to make costly mistakes. JavaScript may be the undisputed monarch of the web world, and the most popular language in the world (IIRC), but it is messy and quirky (see this post for some examples). And please don’t listen to the ones who suggest Java. I could rant about it all day, but I wouldn’t do nearly as good a job at it as Steve Yegge does in this amazing post.

Now that I’ve whined enough, I am compelled to offer an alternative opinion.

I think that the first language one should learn is Lisp. Any dialect is fine, though I suggest going for a modern one. I personally favour Clojure. Racket is another excellent option. If you want to go for Common Lisp, SBCL is a battle tested implementation. Here’s why (note that I often qualify sentences with words like “often” because there are multiple dialects of lisp, and some excel more than others in certain areas):

In addition to that bullet list, I strongly encourage you to read the introductory chapter of Practical Common Lisp to understand the pitch behind Lisp in a much better articulated way and by a far more experienced Lisper. The book is an excellent dive into Common Lisp if you’re picking that up.

As with any other thing of this sort, Lisp is not without drawbacks. And it would be remiss of me to leave you without some sense of what you might not like if you pick up Lisp.

But all things considered, I think Lisp is an excellent first language to dip your toes in the ocean of programming. And I wish you luck in that journey.