David Heinemeier Hansson

May 7, 2023

Programming types and mindsets

One of the longest running schisms in programming is that of static vs dynamic typing. I've heard a million arguments from both sides throughout my entire career, but seen very few of them ever convinced anyone of anything. As rationalizations masquerading as reason rarely do in matters of faith. The rider will always justify the way of the elephant.

That's not to say there aren't people who've switched camps. In fact, such individuals usually shout the loudest rationalizations of all. Often with the charm of a livelong omnivore suddenly turning vegan or a traditional banker who caught a lucky ride on crypto. The shorter the faith, the brighter the flame.

Personally, I'm unashamedly a dynamic typing kind of guy. That's why I love Ruby so very much. It takes full advantage of dynamic typing to allow the poetic syntax that results in such beautiful code. To me, Ruby with explicit, static typing would be like a salad with a scoop of ice cream. They just don't go together.

I'll also confess to having embraced the evangelical position for dynamic typing in the past. To the point of suffering from a One True Proposition affliction. Seeing the lack of enthusiasm for dynamic typing as a reflection of missing education, experience, or perhaps even competence.

Oh what folly.

Like trying to convince an introvert that they'd really like parties if they'd just loosen up a bit. That actually it's really fun to be in crowded rooms, for hours on end, shouting to communicate, because how about that VIBE!

These days, I've come to appreciate the magnificence of multiplicity. Programming would be an awful endeavor if we were all confined to the same paradigm. Human nature is much too varied to accept such constraint on its creativity.

Could you imagine if all visual art had to be rendered in the style of cubism? Or realism? Or all novels written in the short, direct flavor of Hemmingway? What a bore it would all quickly be!

It would ruin the magic of programming. This unique fusion of art and engineering.

But it took a while for me to come to these conclusions. I'm a recovering solutionist. So when I see folks cross their heart in disbelief that anyone, anywhere might fancy JavaScript over TypeScript, I smile, and I remember the days when I'd recognize their zeal in the mirror.

That's not to say all matters of programming approaches boil down to equal but different mindsets. There are limits to this relativism. But dynamic vs static typing is certain within its confines. So too is functional vs object-oriented programming. Poles on both these axes have shown to deliver excellent software over the decades (and awful stuff too!).

Now people are blessed with a capacity to express themselves equally well from either end. Such ambidextrous nature seems rare, though, as evidenced by the utter disbelief so frequently expressed by either side that the other might hold a reasonable position.

I am not ambidextrous. I do not enjoy static typing, and objects animate my mind's eye. But I have come to appreciate the fact that others illuminate their creativity with just as much intensity as I do mine, using functional programming constraints and explicitly spelled out types.

As long as I never have to soil my Ruby with type hints or write all front-end code in TypeScript, I can so happily coexist with those who adore Go or can't stand JavaScript. Vive la différence!

About David Heinemeier Hansson

Made Basecamp and HEY for the underdogs as co-owner and CTO of 37signals. Created Ruby on Rails. Wrote REWORK, It Doesn't Have to Be Crazy at Work, and REMOTE. Won at Le Mans as a racing driver. Fought the big tech monopolies as an antitrust advocate. Invested in Danish startups.