in Thoughts

Shopping for a language

I’ve written my first line of Python about 8 or 9 years ago. I remember buying a small book about it. Having written some PHP it was awesome. The language looked so clean and intentionally designed.

Then about 6 years ago I dived deeper into Python and used it since then quite regularly. Most of my code was written in Python, then some code in JS, Stata / R and C. Now Python 3 is the official standard and yesterday I read a post called Python 3 is killing Python.

I share one side of the argument which is also represented in this post. That is that Python 3 wasn’t a good thing. There should have been Python 2.8 but I don’t want to talk about it.

This article lead me to revise my belief about languages. I was so deep into Python that I didn’t take a look at new languages like Scala, Clojure, Dart and Go. Heck, I even just wrote my first jQuery code a few weeks ago.

The mystical unicorn

The first times I heard about functional programming must have been in esr’s How to Become a Hacker:

LISP is worth learning for a different reason — the profound enlightenment experience you will have when you finally get it. That experience will make you a better programmer for the rest of your days, even if you never actually use LISP itself a lot.

Norvig’s Teach yourself programming in ten years:

[Learn languages …] one that supports functional abstraction (like Lisp or ML), one that supports syntactic abstraction (like Lisp), one that supports declarative specifications (like Prolog or C++ templates), one that supports coroutines (like Icon or Scheme),

And of course Paul Graham. Interesting enough all are role models for me.

Finally doing it

At the time Haskell became more popular and with it some tutorials. So I started learning Haskell. At the time I’ve written code in PHP, C and Python and the abilities of Haskell were insane. It was so elegant and simple.

Later I wrote some Scheme working through Concrete Abstractions. It was really nice. However, all this code was no production code – just for learning.

So I looked around to see if there are books which are more focused on production and found one on Common Lisp. However, one thing that turned me off was the lack of a standard – not a Lisp standard but a standard work environment. There were thousands of lisp implements and dialects and so I gave it up. Because not writing lisp is easy than writing it.

Going shopping

So yesterday I’ve gone language shopping. I wanted to learn a new one. There were a few names which I’ve seem lately which I wanted to look at closer: Go, Scala, Clojure, Rust and Julia.

My “survey” was totally unscientific and I just looked at the project and wiki pages of each language and decided if I want to know more.

My final two languages were Scala and Clojure. Both run on the JVM which is fast and has tons of libraries. Also Go and Rust are more low-level and Julia is more for scientific calculations.

I looked at code of both and Clojure reminded me immediately of Lisp. It really liked it. Here are a few things which are also great about Clojure – so far:

  • Dynamically typed
  • Prototyping should be easy
  • JVM is fast and tons of libraries
  • Code looks great
  • REPL
  • I never learned about lisp macros

An investment?

I read a few articles on Clojure and one talked about how it’s going to explode. I don’t think so. Lisp exists for such a long time and it never really took off. I think a lot of companies just decide that it’s easier to use C / PHP because there are more hiring opportunities. Also developers still find FP harder. I don’t think that FP languages are inherit hard but that developers start with a C-like language (C++, Java, Ruby, Python, etc.) and the transition isn’t easy.

Would I recommend learning Clojure for a job? Nope. There are basically no jobs with Clojure. To be fair there were also basically none in Python when I first started to learn it. But I think it will stay a niche language. I want to end this with a quote which I already posted but it’s still great:

“So next time I hear the “you can’t get the programmers” line I’m going to respond with something like this:

“If you post an advert for a Haskell developer you will get 20
applicants. All of those people will be the kind of developer who
learns new programming languages to improve their own abilities and
stretch themselves, because nobody yet learns Haskell just to get a job.”

“If you post an advert for a Java developer you will get 200
applicants. Most of them will be the kind of developer who learned
Java because there are lots of Java jobs out there, and as long as
they know enough to hold down a job then they see no reason to learn
anything.”” —haskell.org

 

Write a Comment

Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.