Victor Shepelev (zverok)
zverok.space · Personal blog · on HN since 2015
Victor Shepelev, a Ruby developer from Kharkiv, writes about Ruby language design, refactoring, and life during the war in Ukraine.
What HN saysHN links it for detailed Ruby posts, such as method references and the Data class, and for his wartime updates from Kharkiv.
35HN people shared it
9linked it in comments
75stories submitted
2.3Kstory points
3 months agolast shared
2015people per year2026
Most-shared posts
- 1Kharkiv Rubyist during the war: We are still here3 people · 364 points · first shared 2022 · 94 comments on HN
- 2BuyMeACoffee silently dropped support for many countries (2024)3 people · 348 points · first shared 2024 · 318 comments on HN
- 3Rebuilding the spellchecker3 people · 167 points · first shared 2021 · 24 comments on HN
- 4Elixir-like pipes in Ruby (oh no not again)3 people · 17 points · first shared 2024 · 1 comments on HN
- 5I Forgot How to Spellcheck3 people · 9 points · first shared 2021 · discussion on HN
- 6Appeal to Ruby Community from Kharkiv Rubyist2 people · 420 points · first shared 2022 · 102 comments on HN
- 7There is no such thing as a global method in Ruby2 people · 144 points · first shared 2024 · 35 comments on HN
- 8Wikipedia and irregular data: how much can you fetch in one expression?2 people · 25 points · first shared 2022 · 3 comments on HN
- 9Seven things I know after 25 years of development2 people · 14 points · first shared 2025 · discussion on HN
- 10Using Wikipedia as an Impromptu RottenTomatoes API2 people · 13 points · first shared 2021 · 1 comments on HN
- 11"Gilded Rose" refactoring kata in Ruby – as if it is 20242 people · 9 points · first shared 2024 · discussion on HN
- 12Wikipedia as the data source: taming the irregular, pt.12 people · 8 points · first shared 2021 · 4 comments on HN
- 13Some things to know about Hunspell dictionaries format2 people · 8 points · first shared 2021 · discussion on HN
- 14The making of Ruby Changes: A boring advent2 people · 6 points · first shared 2023 · discussion on HN
- 15Ruby language evolution on a large scale (as observed from Ukraine)2 people · 6 points · first shared 2022 · discussion on HN
What HN people wrote when they linked it
zverok · 2023-10-11
Well, first of all, I was one of those who fought for method references as first-class objects for a few years (the story is told in my blog before[1]), and "let Ruby eventually become more functional" was one of my main arguments!
That being said, there are a few problems on this road, that make it less probable to be followed. First, as Ruby doesn't have first-class Method objects (e.g. object corresponding to `File.method(:read)` doesn't exist until you call `method(:name)` explicitly), this style being popularized will either bring a lot of subtle performance problems, or will require redesign of Ruby's internals.
Second, if we'll make an example _a bit_ more complicated, say:
ENV.fetch('CONFIG_PATH')
.then
{ File.read(_1, encoding: 'KOI8-U')
.then
{ JSON.parse(_1, symbolize_names: true) }
.dig('metadata', 'created_at')
.then
{ Time.new(_1, in: CURRENT_TIMEZONE) }
...it would be impossible to rewrite with `method`, until currying would be signficantly improved (currently it can only be applied to first arguments, not tail ones, and even then looks horrible). So it is not impossible, and it is a turn of the language I'd like to see in the future, but it is not as straightforward as I once imagined.
1: https://zverok.space/blog/2022-01-13-it-evolves.html#taking-offense-fo…
lloeki · 2024-02-15
The use case for this would be that it doesn't reify the block IOW doesn't allocate a proc to wrap the block.
... but that optimisation has already been made† (and IIRC it is too for *args and **kwargs that just get forwarded to calls), so it mostly exists for consistency with anonymous * and ** and valueless keys, as well as documentation (making it explicit that the method accepts a block right from the signature). Here's the discussion: https://bugs.ruby-lang.org/issues/11256
I don't particularly like it given the style I like to use, but I can see how people using a certain different style would as their style would be more consistent and carry better intent.
Anyway the post linked from the OP has a more detailed rundown: https://zverok.space/blog/2023-11-24-syntax-sugar4-argument-forwarding…
† https://bugs.ruby-lang.org/issues/14045
bfung · 2022-11-29
They’re both shortcuts to creating class-like things.
Take @dataclass in python for example, that’s similar to Struct for Ruby.
‘Data’ documentation from the GitHub PR (https://zverok.space/ruby-rdoc/Data.html):
Data provides no member writers, or enumerators: it is meant to be a storage for immutable atomic values. But note that if some of data members is of a mutable class, Data does no additional immutability enforcement
See also Struct, which is a similar concept, but has more container-alike API, allowing to change contents of the object and enumerate it.
MichaelMoser123 · 2022-04-06
I hope he is save, he didn't write anything for a while now, last post is from Kharkiv, which is under constant bombardment by Russian forces.
https://zverok.space/blog/2022-03-15-STILL-WAR.html
dmitriid · 2021-12-28
> This is an inspiring series of writing.
Check out his other writing, too, like the "Rebuilding the Spellchecker" series: https://zverok.github.io/spellchecker.html. And "Wikipedia as the Datasource": https://zverok.github.io/blog/2021-11-30-irregular1.html
jaynetics · 2021-12-25
Of course cases where parentheses are omitted will keep working like before, changing this would silently affect huge amounts of code.
See also https://zverok.github.io/blog/2021-12-08-value-omission-debug.html
atombender · 2018-06-03
Good article about yield_self: https://zverok.github.io/blog/2018-01-24-yield_self.html
shevy-java · 2025-12-27
I agree on the first part. This is valid for all programming languages though.
I disagree that you get the same safety as C# anywhere though. But even more importantly - I don't think people should write C#-like code in ruby. It does not really work that well. It is better to write ruby like ruby; and even in ruby there are many different styles. See zverok using functional programming a lot. I stick to oldschool boring OOP; my code is very boring. But usually well-documented. I want to have to think as little as possible because my brain is very inefficient and lazy; zverok has a good brain so he can write more complex code. It is very alien code to me though, but he also documents his code a lot. You can find his code or some of his code here, it is a quite interesting ruby style, but also alien to me: https://zverok.space/projects/
(Ruby also adopted some habits from perl. I also don't think writing perl-like ruby makes a lot of sense. See also the old global variables inspired by perl; I can not recall most of them off-hand, so I avoid using them. My brain really needs structure - it is such a poor thinking machine really. And slow. My fingers are much faster than my brain really.)
ezekg · 2023-10-20
I don't have an Elixir background (though I envy Elixir in many ways), but I absolutely utilize pattern matching in my Ruby code bases:
- https://github.com/keygen-sh/typed_params/blob/4e4982b7d2b263862c9a772…
- https://github.com/keygen-sh/typed_params/blob/4e4982b7d2b263862c9a772…
- https://github.com/keygen-sh/keygen-api/blob/36cd61db143cc1c770cf0e4b8…
- https://github.com/keygen-sh/keygen-api/blob/36cd61db143cc1c770cf0e4b8…
- https://github.com/keygen-sh/typed_params/blob/4e4982b7d2b263862c9a772…
I love it. I want even more pattern matching too, like defp: https://bugs.ruby-lang.org/issues/19764 (with original credit to https://zverok.space/blog/2023-05-05-ruby-types.html).