zverok's space

HELP UKRAINE
I don't build systems. I imagine them, then write them.

Buy me a coffee

On Software Development

My articles on various aspects of software development, mostly Ruby, its style, evolution, and pragmatic approaches; though from time to time I get interested in various topics like spellcheckers or generative art. Also available at Substack.


Some thoughts on how programming’s unlikely relations to poetry, and some implications of those relations

A “stories-first” approach to refactor a small yet complicated piece of business code

Silent changes in payment methods on big creator funding platforms raise some unpleasant questions.

Understanding the core class design and usage via its evolution

One Ruby thing I never noticed before

Episode 01 of studying Ruby programming language design decisions, how they evolved with time, and how they look in a wider context.

On getting back to writing technical texts after three months of silence

Part 1: Welcome to reality

I wrote the analysis of “useless sugar” features of Ruby for two months, and I regret nothing.

A diary of preparing Ruby 3.3's annotated changelog throughout the December of 2023.

A diary of preparing Ruby 3.3's annotated changelog.

A diary of preparing Ruby 3.3's annotated changelog.

Or, about the virtue of exactly one phrase.

Or, how the feature that allows to write less names might make the code more explicit.

Notes to the talk-that-never-was. No pretty illustrations, no code examples even, just a dotted line of thoughts I once intended to make into a talk.

How the small syntactical simplification of allowing to omit values when they names are the same as keys affects code design and structure.

The final part of the article about pattern matching in Ruby, putting it in a broader context of the industry state, possible future usages, and a general effect on the language design.

...or, “but mah polymorphism and encapsulation!”

They said “...just switch to the language that already has it, would you?”

Are they as ugly as I was told?

...and what might be interesting about it

...that were written in a military training camp and accidentally grew to 5k words

What it takes to be a Ruby core member during the war in your country, and why I am still doing it.

A description of a curios core class design decision made for happier coding

Trivial yet easy to mess up a set of things to consider, demonstrated on the latest core classes Time/Date.

Living side-by-side with a beautiful programming language for almost 20 years

To not become "old news," I write to the Ruby community in days of war Russia leads against my country.

I write to Ruby community in days of war Russia leads against my country.

A slightly unusual story of a fail I am not angry with.

Using the idea of a phrase-level expressiveness to design a succinct and unobtrusive query language.

Final part of adventures in understanding, explaining, and challenging the facts that should be obvious.

Further adventures in understanding, explaining, and challenging the facts that should be obvious.

Adventures in understanding, explaining, and challenging the facts that should be obvious.

I spent 24 days digging into the code of {Shan, Shui}* Chinese painting generator and lived to tell the story.

A few days ago, I stumbled upon an article about small JS debugging techniques—right when I was in the middle of debugging my JS hobby project. There is a lot of cool stuff there, but one that stru...

Or, How AI Could Help Coding

On challenges of designing the "query language" for a human-readable encyclopedia.

Some time ago, I wrote a Twitter thread about one of the unseen hard problems in software development—access to the common knowledge. Since then, a few things happened to me, one of the most impor...

Last week I posted an errhm Tweetstorm making a few quite important points: Some of the hardest problems to bring in the software development ecosystem are those that "intuitively" have ...

I spent a year building a spellchecker, and all I got is some grumbling to share. When I started rebuilding the world’s most popular spellchecker, I had several goals. But the main one was: unders...

Hunspell is the most used spellchecker in the world. It is built-in Mozilla Firefox, Google Chrome, Libre/OpenOffice, MacOS, Adobe products, and whatnot. Thus, Hunspell dictionaries are the most c...

This is a part of the ongoing “Rebuilding the spellchecker” series, dedicated to explaining how the world’s most popular spellchecker Hunspell works, via its Python port called Spylls. You can star...

This is the fifth part of the “Rebuilding the spellchecker” series, dedicated to explaining how the world’s most popular spellchecker Hunspell works. Today, we talk about edit-based suggestions. ...

This is the fourth part of the “Rebuilding the spellchecker” series, dedicated to explaining how the world’s most popular spellchecker Hunspell works. Today’s topic is suggest! Quick recap: I...

This is the third part of the “Rebuilding the spellchecker” series, dedicated to the explanation of how the world’s most popular spellchecker Hunspell works. Quick recap: In the first part, I’...

This is the second part of the “Rebuilding the spellchecker” series, dedicated to the explanation of how the world’s most popular spellchecker Hunspell works. Quick recap: In the first part, I’ve ...

How I decided to write a spellchecker and almost died trying TOC for the entire series (work in progress). A few years ago I had a fun idea for a “weekend project”: pure-Ruby spellchecker. Ruby i...

Just yesterday I suddenly understood that there is a small neat trick, allowing to provide friendly error messages for missing method parameters: # default way to do things: def read_data(file) ...

Well, the title says it all! But let me explain. Last week, I stumbled upon a new APL apology post. It struck some deep chord in me and gave me an impulse to make another attempt to understand thi...

A short preface: I am writing in Ruby since 2004. For last 5 years I am also participating in language development, documenting new and old features, proposing some (several got accepted) and divin...

It happened so that this blog was started almost 3 years ago with post about exercise in imitating pattern matching as a Ruby library. That was fun, but ended in a sad realization: All in all, ...

Imagine your friend, thinking about learning programming, or switching to new languages, asks you: OK, I’ll give your beloved Ruby a try, point me to the language reference, I want to taste it....

Since my previous article about Ruby 2.5 new #yield_self method I started to use it a lot—in production and experimental code. Here, I just want to share several code samples/ideas of usage, where...

There is one small yet tricky thing when testing some HTTP APIs with RSpec: how to properly and idiomatically test response’s JSON? That’s where you typically start: let(:response) { call_my_api }...

Well, occasional reader of this blog is no stranger to strong statements, so here is one more of them. For a short preface, lets reiterate about one useful Ruby idiom: Kernel#Array method, a.k...

…the name still sucks, tho As you probably have been told, Ruby 2.5 has introduced Kernel#yield_self method, now available in any object. On the first sight, it does nothing fancy: just, as the na...

A few days ago, I’ve posted on /r/ruby announce of some RSpec matchers/plugins library, and it met with a (not very heated, TBH) discussion that I’ve expected, seen several times, and now want to f...

What’s inside: A useful rspec/rspec-its trick for testing methods with arguments + philosophical explanations why I consider such tricks a good thing. The task Currently we are working hard on da...

Japanese translation of this post is available! Recently I’ve read (informative and well-written) article called 7 Gems Which Will Make Your Rails Code Look Awesome, and my eye was caught with...

NB: This small case study was published as pre-RubyKaigi 2017 appetizer for my talk. Wikipedia and its “sister sites” (Wiktionary, Wikivoyage, Wikisource etc.) currently is the most comprehensive ...

TL;DR: This post shows why you probably should consider using “The Last API Wrapper” next time you need to get something from HTTP API. GIPHY’s API is taken as an example. Preface Idea of this e...

Really short version For an “informational” HTTP APIs (like weather, geonames and similars, currencies, movies, transportations and so on) there are typically “wrapper” Ruby gems created. In most ...

What? RSpec API is constantly evolving towards as DRY and readable DSL as possible. Though, there are several things (tricks and additional methods) that could make your specs even DRYer. Warn...

UPD: It was a ton of really heated discussions around this post. I want to emphasize: the text below is NOT a critique of MiniTest. It investigates difference of approaches to Ruby programming: “ge...

Here are (semi)random notes, trying to outline a system of views on controversional “monkey-patching” topic—the views I myself consider sane and reasonable. It may seem other way for you, but it co...

What? In this short post I’d like to show how some of RSpec components (matchers and expectations) can be used for a greater good outside your tests. Like in your normal everyday scripts. Why? T...

When I’ve started to design time_math2 gem, I’ve already had a strong set of opinions in my head, of why and how it should be done. Like: concise set of well-defined operators for math arithmet...

Remember the Reality library? That thing which wants to make the entire world inspectable and computable through Ruby, Wikipedia, Wikidata and other data sources? Like this: E('Eiffel Tower').coor...

This day is a big day for me. With the help of my friends and contributors, I’m releasing in public the thing we’ve worked on for almost a year: reality. It is an ambitious project, trying to make...

Any tutorial and book will teach you there are two sets of similar operators in Ruby: &&/|| vs and/or (and also &/| for bit operations, but that’s not the case today). But typical tutor...

Just a quick reference post. There are several pairs of type coercions methods in Ruby: to_i and to_int; to_s and to_str; to_a and to_ary; to_h and to_hash. What’s the difference and w...

TL;DR: We need DataFrame as a data structure in Ruby. There are several promising candidates but no one with good usability. Some considerations on requirements to good DataFrame library are propos...

We are releasing Infoboxer version 0.2 today – which is still young but already highly useful MediaWiki (including Wikipedia) hi-level data client. Please look at Infoboxer’s showcase to have a fe...

TL;DR: Readme-driven development (writing README and usage examples before the code) is considered to be an effective way for designing a public interface for a new library. A tool for automating r...

Preface: “Thou Shalt Not Complicate” is planned as a series of strong rants on programming in general and Ruby programming in particular. The main thought is dead simple (and already emphasized in ...

I remember times when Wikipedia seemed a new thing (and the times with no Wikipedia at all). Despite all the critique, sometimes reasonable, Wikipedia have grown to be a fascinating source of “comm...

Short Preface Many years ago, when I considered myself a C++ expert (which was presumptous yet excusable for 19 yrs), I’ve liked to think something like “My language is the most powerful and expre...