What if they are both good choices? :)

JavaScript vs. CoffeeScript is to Running vs. Cycling

Being mindful about your choices

Dion Almaer
4 min readJul 16, 2013

--

In the space of two hours I had two conversations that felt very similar but were in very different contexts.

Conversation 1: Shall we use CoffeeScript or “naked” JavaScript

Conversation 2: Shall I run or bicycle?

I noticed two levels of abstraction in the discussions.

High Level: It Doesn’t Matter

When it comes to building a great experience for your user do you think that the deciding factor will be the technical choice between JavaScript or CoffeeScript? I hope not. Maybe it would be better to spend some of the mindshare on what user needs you are solving. We have all been there. Hell, The Internship even had a joke about vi vs. emacs. Religious wars are common.

The same can be said for the exercise discussion. The choice can create stop energy (famously noted by Barry Schwartz) so instead of run or cycle you come out the end with neither. When it comes to cardiovascular health, the most important factor will be choosing ONE of these (or something else of course).

Low Level: The Details Matter

It is easy to look at the high level and poo-poo the discussion. The details do matter though. A couple of factors that I tend to weigh are:

What will make me most excited?

If I am really excited to use CoffeeScript, that alone may be enough to push me over the edge. If I am jazzed about it I will work harder at the problem, and this passion will result in a better project. Beware of the ramifications though. You may feel like it will be more fun but in reality that may not become Truth. On the downside you may spend much time getting some bleeding edge thing working, and there may be the cost of learning something new, and then of course there is maintenance and leverage to think about. I try hard to take a step back and really look at the details before making the gut feel jump, and also have an chat about “can I instead feel more excited about what I am building over how”.

What are the social ramifications?

No one is an island. How does the entire team feel about the choice? I try to not be selfish and get excited about doing what makes sense for the team.

I have to admit that writing in CoffeeScript often makes me happier as it feels right. This is how I feel about Ruby too. It fits my brain. One of the reasons that I like CoffeeScript is that as well as fitting my way of thinking, it is close to the bone rather than a huge abstraction. For example, compare to something like GWT where in theory a Java developer can just write something but in practice you bump up against the leaky abstraction. It is wise to actually understand JavaScript even if you don’t write it all day long. When you sit on top of another platform you also run into ownership issues. For example, ES5 is learning from CoffeeScript and will have changes that conflict, so it will be interesting to see how that all comes out.

You can’t predict the future

The team changes. Context changes. I am trying to consider maintenance and the long term more and more. If I value building a solution that can be maintained and changed easily… and one that allows new members to join the team and get up and running, then I will be future proofing.

When it comes to the exercise question, your team mates can really matter too. Buddies on a running team that you want to hang with? Cycling to work? It has been shown time and time again that social pressure matters a lot, so consider that as part of your choice.

Many folks have told me I just don’t like running. I felt the same way, but gave myself a month to see if I could change that feeling. It did take about a month but I came out the other side. This is not to say that you should choose running when you would prefer to cycle though. Making a choice that you have the best chance of keeping up with is the most important factor. I was trying an experiment to see if I could use mind over matter. I really wanted it to work as I feel like I get more bang for the buc with running, in that anything from 30 minutes to an hour is a real work-out. I have friends who go on multi-hour rides which sounds fun… but I didn’t want to take that time.

Now I need to try mind over matter with technology too. What if I gave Clojure a month long chance? :)

--

--