Charlie Harvey

Seven Languages in Seven Weeks: Notes towards an epilogue

I’ve finally finished my seven languages in seven weeks adventure. It took, as I’d oringinally expected, significantly more than seven weeks, though the actual amount of time which I dedicated was only a couple of days more that the amount allocated in the book. It was just that the weeks were non-consecutive.

Seven Languages In Seven Weeks By Bruce A Tate, Front Cover

I’ve mostly found the experience an enjoyable one, though occasionally frustrating and frequently baffling. There have been a few times when I’ve wished I was back in my beloved Perl and times when my mind has been truly expanded by the awesomeness of a language feature.

Did it make me a better programmer? I think it might be too early to say.

Its fair to say that there is something of a bias towards functional languages, which are going through a bit of a rennaissance these days. They do have features which make more sense on today’s hardware — trading off some extra expressiveness for some memory or time is really a no brainer now that the chances are that you’ll be running in an environment where there is capacity to do that. I assume that the compilers probably do all sorts of wizard shit that the compilers of 20 or even 10 years ago just couldn’t do.

The Languages: How I Got On With Them

It was nice to start with a familiar language, Ruby. I’ve written a fair bit of stuff in Ruby and its just a lovely language, combining stuff from Perl, Python and a host of other places but doing it tastefully and elegantly. It makes a good language to illustrate OO and one which I suspect most jobbing coders would have little difficulty enjoying.

Io felt like a bit of a toy language. In a good way. It fits a niche for a tool that could be used to bodge a demo or proof of concept together. While it was nice to look at, I doubt that I’d use it again. Which is not to critiscize its minimalist approach — its more that I want to prioritize doing things that are hard in perl or other languages I know.

Prolog’s constraint-logic programming I found a little baffling until we used it to solve a sudoku. That blew my mind; I’ve written sudoku solvers in Perl and the results ain’t pretty, I can tell you. I thought of all the ways I could use something like that. Prolog was a struggle. It was just so different from other programming, except maybe for writing SQL. I think that struggle made Erlang seem less strange when we got to it. During the Prolog week, I also learned that internet connections on ferries have massive latency, which makes searching the web for some syntax definition painful.

Scala? It was ummm OK, but well, a bit irritating actually. If it wasn’t for the annoyances of static typing and particularly the JVM’s static typing Scala might have been something I wanted to put more effort into learning. As it was Clojure was more my sort of thing. A little further from Java, a lot more simple and expressive. And dynamically typed. Mind you Haskell’s implementation of static typing I actually found pretty livable with. Well, I guess if I was doing a big Java project I might use Scala to save some typing and to make it at least more possible to use list comprehensions, functional programming, pattern matching and such, but knowing that I could use the interoperability stuff to both reuse existing libraries and (probably) write some more OO bitsn pure Java.

Along with Haskell and Clojure, Erlang was one of the languages I got along with best. It somehow managed to do some of the neat stuff from Prolog, while still feeling a bit friendly. The concurrency model was eminently grokkable and we built some cool things with it. I definitely want to look at Erlang in the future. I’m just not quite sure what to make out of it.

Clojure was lovely, we got on much better than me and Scala did. I’ve looked at various Lisps before as I’ve always sort of felt that I ought to know a Lisp. But Clojure just sort of clicked. Its STM concurrency model felt smooth and comprehensible. There seems to be a reasonable community round it. OK, there was a lot of brackets. True dat. Don’t think I’m turning into some kind of Lisp fanboy. Not quite yet. But I’ve got a nice VimClojure rig set up and I’m planning on working my way through Abelson and Sussman’s MIT course, The Structure and Interpretation of Computer Programs, translating from Scheme to Clojure as I go. So, who knows?

And so to Haskell. Which is weird and crazy and made me want to tear my hair out. It is just so alien. The minimal syntax gave me nowhere to hide from the algorithim. And figuring out the algorithim was by no means intuitive without any kind of state. But of all the languages it was the one I enjoyed grokking about the most and the one that I had to put most into grokking. I am currently making my way through Learn You A Haskell For Great Good and watching A series of programming in Haskell lecture videos to get my head round the language. I feel like I am learning to program all over again. It’s definitely helped me start to get my head around this whole functional lark. Even though Haskell is mad and geeky its also frighteningly awesome in a lot of important ways. I think seeing how I could implement the net of Eratosthenes in 3 really clear lines was my first breakthrough moment. Though I’ve not been able to solve a fucking maze that works like an undirected graph yet!

Final Thoughts

Tate wraps up the book with a review of all the subject matter he covered along with some thoughts on some of the (and I hate this phrase) programming paradigms that the book had introduced. That is OO for Ruby, prototyping in Io, constraint logic in Prolog, and the functional programming models of Scala, Erlang, Clojure and Haskell. He moves on to investigating specific approaches taken by the language designers to concurrency and a few of the programming constructs that came up in several of the languages.

And here I’ll wrap up too. Its been an interesting ride and one that I can thoroughly recommend taking if you want to expand your coding repertoire or just have a little adventure in programming.


Comments

  • Be respectful. You may want to read the comment guidelines before posting.
  • You can use Markdown syntax to format your comments. You can only use level 5 and 6 headings.
  • You can add class="your language" to code blocks to help highlight.js highlight them correctly.

Privacy note: This form will forward your IP address, user agent and referrer to the Akismet, StopForumSpam and Botscout spam filtering services. I don’t log these details. Those services will. I do log everything you type into the form. Full privacy statement.