HNHacker News
TopNewBestAskShowJobs

zhisme

269 karma · joined January 16, 2025

Pragmatic software engineer

My blog available at https://zhisme.com/

submissionscomments
zhisme··on Past, present, and future of Sorbet type syntax
With great power comes great responsibility.

It is developer responsibility to ensure that you will not receive cat during designing stage of your classes. And inheritance is bad, this is also sharp knife. But annotating everywhere

      sig { params(cat: Cat) }
does not improve your design, it just makes noisy and clumsy. I would think that if your code need type annotations, it smells like bad design and should be considered for refactoring.
zhisme··on Past, present, and future of Sorbet type syntax

  Ruby is a language that grants you lots of freedom.
Nobody can argue that. With freedom we can do anything, but anyone wondering why in first place?

What about wisdom and pragmatic approach? If you ever need types why not choose typed language for your case, but instead re-implementing something and wasting so much time for work that has no real use. Why not use c-bindings for typechecks, this feature is already available in ruby *rb_obj_is_kind_of(value, rb_cString);* and has no cost. Is it wise? I don't think so, I would be shocked if I saw such code in production.

We care so much about environment and climate changes, but think it is ok to waste resources for such activity. It is not research task. People really advocate to use in real-world applications such thing as sorbet. DHH even removed typescript from his frontend libraries, and this types is like kindergarten for some homemade rack/hanami/dryrb application that will server 2 people in production (creator of this stuff and random visitor). Maybe someone could tell me why we need such thing in ruby ecosystem like rbs/sorbet library. I'm really wondering. Not because ruby grants us freedom and we can do that. That's not an answer. We can do enormous count of absurd things. But the question is why?

← PreviousPage 2 of 2