So many languages...

One of my favorite pastimes is trying new programming languages. Reading books, tutorials, talking with people who use them and make them. For the last 10 years or so, I’ve tried almost every major language out there and a whole lot of the smaller ones. This started because I got curious what the ‘best programming language’ was. A simple Google search told me it was Common Lisp and I immediately tried it. Learning this was an eye-opener and it made me curious what else was out there. It evolved into a quest for the holy grail of programming languages. Learning as much of them as I could, I discovered new ways to tell a computer what to do and new ways to think about computation. I’m not an academic, I look at these languages in a more pragmatic way but I have started to appreciate the different directions the academic languages have taken.

In this post I write down my thoughts on what is important in a language and what is important when learning a new language. At the bottom of this post there is a list of languages and my opinions on them.

The best one is…

So you may think I’d come with some grand conclusion on which languages are bad and which is the best. Of course that didn’t happen. It did give me a taste of them. I went very wide but rather shallow. I’m no expert on Haskell, Prolog or Lisp, nor any other of the languages I’ve sampled over the years, apart from a couple that stuck with me. But I did try to use every language to build at least a small program that solved an actual problem I had. Usually these were simple things like an IRC bot or a Twitter library that gets the information about 1 single tweet.
Trying a lot of languages gives me more choices to consider when tackling a new project. Not all of them are true ‘general purpose’, but when a problem pops up that benefits from a certain way of thinking I know which languages can help. At that point, I dive deeper into it.

TTRW

There’s a benchmark called ‘Time to Hello World’. It basically measures “how long does it take for a newcomer to a language to get the ‘Hello World!’ program to run?”. From installation of the language to running the code. This can be a good benchmark to see how friendly a language is to beginners. I’m testing something similar, I call it ‘Time to Real World’. How long did it take me to write a small program that touches the filesystem, the network and used an external to do something? For a lot of languages, this can be truly disappointing. I concede that it is not the best benchmark to grade a language on, and I don’t. But it gives me an indication of how steep the learning curve is.

Some examples: For Haskell, this takes quite a while. Not only because you need to learn the language first, which is for most people a huge departure from how they normally think about programming. But also because the tooling just isn’t good. Stack? My hdd thanked me when I cleaned all of that up. Installing 2 libraries with similar but not exactly the same versions of a common dependency? Sorry, we’re going to crap out on that. Yeah Haskellers will flame me and try to tell me how to do it. I’m sure it’s perfectly possible, but it’s not clear at all for a newcomer. The documentation is lacking or opaque.

For SWI-Prolog (a popular Prolog implementation, there are many), there’s a similar predicament, although it is better there. But there the learning curve for the language and more importantly how to use it properly is even steeper. (But it remains one of my favorites nonetheless,. Biggest mind-f*ck I had was not Haskell, it was Prolog and it made me a better programmer.) By comparison, OCaml was better: opam is a nice system.
Racket also does pretty good, raco is easy to use and well documented.
Python makes TTRW a breeze because it’s “batteries included”, but even when using external libraries, pip is easy to install and works well.
Nims ’nimble’ is very easy to use and it ships with the language, no need to install a package manager.
Go has the ‘go get’ command, it can’t get much simpler than that.
Remember, I’m talking about how easy it is to get going as a beginner, not how good the library systems or libraries themselves are.

Some languages make it nearly impossible, like Ada, though that language probably doesn’t focus on the hobby programmers tinkering in their spare time. (I wonder how you learn Ada. On the job? Just from the books?)

Read the fancy manual

One of the big things with learning any language is the documentation and the learning resources. Most creators and communities try to do a good job, yet few of them really succeed. Younger colleagues of mine are always looking for video courses. I’m more of a book person myself, so I always search for a good book to introduce me to a language and put me on my way towards writing larger programs.
Here Haskell does rather well. There are a lot of great books available, free and otherwise. Not all of them are up to date because the language moves fast, but still.
Erlang for example is amazing here. All the books are still relevant and you can learn Real World™ stuff from them. The languages with the big communities have an advantage here of course, but even some of the smaller ones do a good job. For example: Nim has a good book and you can find a lot of stuff online, considering the relatively small size of the community. Or teaching languages like Racket that have a wealth of documentation available.
The worst is when you find out-dated stuff or even brand new stuff with examples that don’t work.

Community

Another big thing when evaluating a language is the community. What is a ‘programming language community’ anyway?
For me it’s the people who answer questions on StackOverflow, the folks on the forums, the mailing list and those in the IRC channel or if you must, the Discord channel. There can be many differences between language communities. In some language channels, you get scolded for asking a dumb question. Other channels you get a nice explanation and sometimes you just get a link to the appropriate blog post explaining the thing you were asking about. Sometimes you land in a ‘holier-than-thou’ channel that just complains about how you don’t have a CoC in your open source project. There are languages where you feel you’re trespassing on some ancient tribes land, and languages where they almost beg you to stay and will go out of their way to help you.
The community can be a big factor in deciding if I like a language. It has nothing to do with technical merit, but it’s still important. These are the people I’m going to ask questions about problems I’m having.

The list

You’re still reading? Or did you scroll down to this list? In any case, I’ll take a stab at this.
I like lots of languages for different reasons. In no particular order:

  • Factor: I’m so sad this has died out. It is truly a hidden gem. Try it if you want your mind blown in a way you hadn’t thought of.
  • Ada: It’s so clean. Yes it’s verbose but I think this is a good thing actually. The type system is nifty.
  • Racket: Such a nice system. I’m not sure what language people should learn as their first one, but I am sure that you can’t go wrong with Racket in that regard. It’s a truly modern Lisp once you get more familiar with it and a Lisp is something every programmer has to try at least once.
  • Haskell: Interested in typed functional programming? Start here. I’m convinced that jumping in the deep end for FP is the way to go. It’ll force you to think in the FP way. Makes you a better programmer even if you never use it again after learning it.
  • Prolog: One of my personal favorites. It will change your view on computing in general. Also a must-try for every programmer in my opinion.
  • OCaml: FP but not OCD. There is a reason a lot of programming language implementers start their own language in OCaml.
  • C#: Yes, an enterprise language in this list. I use this at work and I can’t really complain. The language has a boatload of features, it’s fast and it writes quickly. The tooling for it is best in class. You have to buy in to the ecosystem, but with .NET Core that doesn’t limit you anymore.
  • F#: ‘OCaml for .NET’ is seriously underestimating this language. I wish I could use it more at work. Same thing as C# for the tooling. Once you get used to Visual Studio, it’s hard to go back to anything else. Had a lot of fun making stuff for myself in this language.
  • Smalltalk: One of the classics. You have to experience it to ‘get it’. It’s a shame they aren’t used more, but there’s a reason for that. One you’ll experience when you start building stuff that has to interact with other programs. Still, it’s one of the cleanest systems you’ll ever see. Probably the best syntax of any language I’ve tried. I wish I found this language when I was in my teens.
  • Nim: So cool. So many fun things here syntax-wise. Amazing effort from a few people.
  • Common Lisp: The language I started with when beginning to really explore the landscape of programming languages. This has libraries that are older than some newbie programmers. And not because they’re not maintained, but because they still work. What other language can you say this about? It still has a special place in my heart because it opened my eyes.
  • Go: Even though this gets a bad rep from language purists, I like Go. I’ve started using it at work some time ago and it hasn’t let me down. But you need to learn how to use it properly. Good libs, good performance, friendly community. And code that is still readable when coming back to it after months. Not something many languages can do.
  • Erlang: Pretty much blows everything else out of the water for servers. Best time I had programming. I created services for my job in months that still run, 7 years later, no maintenance, no downtime. Simply incredible. I’m not using it enough these days, but that’s because Erlang is not a good fit for what I’m writing right now. If I get back to writing services, this is number 1 on my list. (The list has 1 entry btw.)
  • Lua: In my opinion, the nicest scripting language there is. It’s so small and elegant. Too bad running it standalone is a pain. I’d embed this as a scripting language in my software over anything else.

Didn’t see your favorite language? That’s probably because it didn’t make an impact for me or I haven’t tried it. I just wanted to share the ones that stick out for me.

There’s still stuff I want to play with still, maybe those will happen later this year: Logtalk, Pony, Crystal, more Prolog, probably more F#, whatever new shiny language comes out and definitely Plasma.

I pick a language based on how I feel after I’ve programmed in it for a while. After learning enough of it to get started of course. If I’m frustrated too many times, I’m not likely to use it again. Not everything has to be an exact science and nobody should be ashamed of the language they use. Programming languages are more than the sum of their parts, the purely technical stuff isn’t the only thing you can decide your choice on. If you’re having fun, you’re probably using a good language for you.

Found an error? Don’t agree? Find me on Mastodon. I’m always looking to improve my knowledge.