(This “use this blog to write about stuff that isn’t just technology” thing isn’t going so well, is it?)
I spent Sunday writing a personal project that I hope to announce here soon. Part of it is written in Python, and part of it is written in Ruby. The Python component is helping me to better learn Apache Airflow, which we are starting to use at work. The Ruby component is a Web frontend (and data ingest API) written in Rails.
I will readily admit that it’s probably not fair to compare a framework I’m still learning with one I’ve used since 2011. But I’ve been writing Python since 2007, well before I learned Ruby in 2010. I’ve additionally used Python more consistently professionally. Python was pretty much the only language we used in my role at IBM, and it featured heavily in the two roles before that. My role at the Library, which I started last May, is the first role I’ve used Ruby at since 2014.
And yet, even to this day, I find Ruby so much better to write. I enjoy writing Ruby, in a way I do not enjoy writing modern Python. On the surface, this doesn’t make a lot of sense. Python’s grown lovely things like an optional type checking system (not enforced by the interpreter, but very well used by tooling) and an asynchronous processing system. I can’t imagine a Ruby syntax for type checking, and Ractors have been experimental since Ruby 3.0 and are still experimental to this day. They’re supposed to be going production-ready “soon”.
The standard libraries are pretty equally matched as well, in my opinion; at least the bits I use. I do wish Python had a built-in dig-like way to safely probe into dicts the way you can a Ruby Hash, but there are actually Python modules that add similar functionality.
I don’t think it’s down to Rails, either – I do love writing Web apps in a framework that doesn’t make me feel like I’m fighting it every step of the way, but I write Ruby without Rails. I used RSpec for Horizon’s test suite, even, because it felt comfy. My throwaway “go through these files and fix them in some way” scripts are 90% Ruby (and 10% POSIX shell).
Why, then, do I prefer a language that on paper is supposed to be poorer in every way? The once revered Wired (which I have come to loathe for clickbait headlines that make light of fatal cancers) even ran an article near Christmas that ends on this lovely stanza:
Ruby persists, for now, as a kind of professional comfort object, sustained by the inertia of legacy code bases and the loyalty of those who first imprinted upon it. But nostalgia and a pretty name won’t cut it.
But it’s not nostalgia that keeps me in Ruby. Nostalgia would lead me to various dialects of Basic or assembler. It may be why I still grab on to C++ – it was my first OO language, and I remember wanting to learn it ca. 2001 because so many cool apps and games seemed to be written in it. But 2010-2014? That was my startup era. I loathed every part of that era. If Ruby was at all to bring back memories, they would be of 18 hour marathon coding sessions, attempts at meetings over Skype video using poor EDGE connections, and my GP telling me if I kept on living the startup life that I would be in liver failure within 6 months. I can confidently say that it is not nostalgia that makes me enjoy writing Ruby.
Perhaps Robby from Planet Argon said it best in his response to that article:
[T]he sentiment wasn’t nostalgia. It was gratitude. Gratitude for a language that centers the human being. Gratitude for a community that believes programming can be expressive. Gratitude for a tool that makes the work feel lighter without making it careless.
I think this is close to the feeling I have. Ruby feels comfortable. Ruby makes me feel centred. When I’m writing Ruby, I feel untethered. Programming has always felt to me like a mixture of the left and right brain. It is equal parts engineering and creativity. With Ruby, I can express my creativity at the same time I am engineering. Python, while being a fine language, just doesn’t give me that same feeling of creativity and free expression.
As I grow older, I find myself wanting to spend as much time as possible using my talent and skill in ways that I can also enjoy. I want to make the world better without making my own world worse. And that’s why, at least for this dog, Ruby remains my favourite language.
Pingback: Stumbling on a work bug in a personal project | The Dalmatian Life