main logo

I'm Sebastien Orban and I'm a hacker and a painter.

05 October 2014

First validating experience with Om and ClojureScript

A new project, a small calendaring web app, was the perfect occasion to try new things : see if Om and ClojureScript are up to what they seem to offer. So, after three weeks, it's time to look back and think about the lessons learned. First : LightTable is a nice editor, and the integrated browser REPL is very cool. I don't regret being a backer - now, I concur with Chris Granger that a simple editor, even with a REPL as good as this one is not The Answer. Second : REPL development is a dream come true. The Clojure/ClojureScript one is very nice - but not as nice as CommonLisp to be honest. The Java error that keep on coming are sometimes pretty obscure, and we can't dive in the stack trace as easily, and interacting with it is not possible. Being able to continue computation and not restart it from scratch is a nice convenience. Third : jumping in still the best way to learn something. The current code is not perfect by any measure - the better understanding you get after a while means you'll have to refactor after... but you'll have something to work on. Oh, and it's not necessary to KNOW everything : build your knowledge, keep on improving it and soon the code will be excellent.
One thing to keep in mind : some subject can be harder than other. Objective C was not a fun ride in 2010 : the doc, while good, can be sometimes confusing. It can be the same with Clojure, but most of the time simple example are there to help you knit things together, and the fact experimenting is a given with the REPL helps a lot. Fourth : Om, and probably ReactJS, is a fucking improvement to the life of the web dev. It's such a logical way of thinking, it's so obvious that it seem surprising it begs the question of why it's only now that we got it. What's more : the immutable way of Clojure help greatly to keep everything straight. All is laid in front of you, and it's gonna change because of some side effect far away. Now, let's dream of something akin of that but with the freedom of a GOOD UI abstraction, not the DOM. Five : Be it in PHP, CommonLisp, Objective C, JavaScript, Clojure... there's no silver bullet for time manipulation. It's hard and unpleasant. At least in Clojure you'll have the CLJTime wrapper over JodaTime, and in JavaScript MommentJS. But at the moment you leave one cosy environment, to insert stuff elsewhere, like in Postgres, hell is back !

To summarize : it's such an improvement over a more travelled way of development that it's not even fun to think about it. More, please !