Why Learn Ruby?
Yesterday I mentioned to Aigiz that I was taking a slow dive into Ruby and Ruby-on-Rails on my own time. "Do you think it is worth it?" - he asked.
That is a very good question, warranting a proper response. So here we go.
Short answer would've been "Fernweh"
To provide context to the question: Aigiz is my colleague at Softwarepark. However, we had been working together long before that - probably for 15 years or so, across different projects. We've been through the beginning of ASP.NET at idocuments. We worked with early Azure, Lokad.CQRS and big data in retail at Lokad. We've scaled together Lokad.CQRS at SkuVault. For the last two years we were knee deep in Python, golang and data science ecosystem at Softwarepark.
At this level of shared experience, we have a similar perception of how things work and how peculiar software decisions work out in development and hurt in production.
Among the other things, together we figured out applicability rules for general-purpose languages that work for us:
- C# and .NET Core - powerful, flexible and verbose. It can scale to large codebases, but requires smart tooling and IDEs to maintain. Good fit for good old boring business applications. Compared to other languages, it requires so much ceremony to start writing things, that we rarely touch it these days.
- golang - performant language with outstanding concurrency primitives. It is simple to start with, but becomes verbose if you try to capture a complex business domain in it. Golang worked great for us in the infrastructure, middleware and small command-line utilities.
- JavaScript (with dialects) - reigns supreme in the browser. Outside of the browser, there are better options.
- Python - perfect language for prototyping with a rich ecosystem for data science and pretty much everything else. It reads and writes like poetry when applied to scripting and configuration. Python has a performance of interpreted language. Its parallelism is limited by the Global Interpreter Lock. We love Python.
I'm leaving out of this page: lisp dialects (Clojure, Scheme, CL), beautiful Erlang, Rust, F# and Haskell. They are good on their own, but we've never worked in the niches where these languages were a compelling choice.
Given all that, why bother with a niche language like Ruby? It isn't going to make things run faster. Being an interpreted language, it performs on par with Python. It has a similar global interpreter lock (GVL), so parallelism isn't feasible within a single process (not until guilds are released, at least).
It also appears that market demand for Python is at least 5 times greater than for Ruby.
The answer is about searching for comfort, happiness and a new experience. I want to find a language that is even more fun to develop applications in.
Application can mean anything these days. In order to simplify the problem, let us define the goal: deliver web applications efficiently. Efficiently here means saying no to unfit technologies, no to waste of time or slow iterations.
Companies with teams and budgets can afford inefficiencies in software design and development. Personal projects are far more sensitive - a few dumb decisions and the project grinds down to a halt because of all the technical debt.
Let's break this down to a few specific constraints:
- Applications need to have a web UI to interact with people regardless of their OS.
- Application scalability isn't a big problem; hardware is cheap these days.
- No single-page applications, client-side rendering or smearing the logic between backend and front-end.
- No to microservices or serverless architectures.
At this point we are searching for a language (and ecosystem) that will make a silly me productive and happy while building web apps in a very opinionated way.
Given the narrow constraints, that could be a very sharp tool, were it to be found.
That's how we come to Ruby, the language.
Ruby seems to be one of these niche languages that chose to focus on developer productivity and happiness instead of performance. It tends to run slower than Python on benchmarks. Ruby-on-Rails (the web framework on Ruby) is considered by some to be the most productive web dev environment. Folks behind the RoR are the same who built Basecamp, wrote "ReWork" and have strong opinions in favor of software monoliths.
At this point, I would feel myself uncomfortable if I didn't try learning Ruby and RoR. If I'm lucky, I'll also find a tool that is a pleasure to use for the specific tasks.
Update 7 months later: [[L32 ruby-on-rails|How did learning Ruby on Rails go?]]
Published: March 03, 2020.
Next post in Opinionated Tech story: How did learning Ruby on Rails go?
🤗 Check out my newsletter! It is about building products with ChatGPT and LLMs: latest news, technical insights and my journey. Check out it out