4 ms·
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 abou
by zhisme 1y ago
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?
- phoronixrly 1y agoWoah there, you're making a straw man here but I'll bite. I'll preface it with the fact that I also think types are against the very nature of Ruby as I know and practice it. But, why not choose a proprer statically typed language? Because you've inherited a mastodon of a legacy app that started simple, then matured with thick layers of features. How can you wrangle this? Oh just rewrite it in Rust. Or you could seek an iterative approach and introduce tools to help you. Like bolted-on types. Oh and I'm not sure I follow what all this about the environment is... If one is so conscious about it, maybe choose a different field entirely?