ruby / philosophy

These articles describe my Ruby style at the end of 20 years of writing Ruby, from 2006 to 2026. I ported the last codebase I worked on from about 200,000 lines of Ruby to Go.

My approach

I wrote small Ruby I could hold in my head. A Rack app instead of Rails. Plain SQL instead of an ORM. Thin HTTP clients instead of vendor SDKs. A custom test framework. A restricted Haml subset for HTML templates.

Each dependency is an interface to learn and a security surface to patch. When something breaks in a small codebase, the stack trace points at my code.

Why I moved to Go

I moved to Go for the reasons I wrote minimal Ruby.

Performance. The rewrite cut page response times across the application.

Type-checking. The compiler catches at build time what Ruby left for runtime.

Object-orientation. Most of my lib/ was plain objects with an initialize and a call. Go has no classes or inheritance, only structs, methods, and small implicitly-satisfied interfaces. My Ruby already followed that style.

Error handling. Go returns errors as values. The caller checks each one, so every failure path is explicit. A Ruby exception travels up the stack unseen.

Tooling. goimports, go vet, and the race detector ship with the language.

Security. The Go standard library covers HTTP without a gem. Fewer dependencies leave a smaller security surface.

Dependencies. Go pins module versions and verifies them against a checksum database. https://rubygems.org serves mutable gems from a single registry.

AI agents. Programming agents get compiler feedback as well as test failures.

The Go versions of this work live under go / postgres, go / job-queues, go / web framework, and go / html templates.

← All articles