News for hackers. Stuff that matters.
Re:An Introduction to Metaprogramming in Ruby by benkitzelman on Thursday July 27, 2023 @07:23PM (#36901402)
We have hundreds of thousands of lines of ruby code spanning many services / monoliths. Even now I find it somewhat annoying to open a controller / component that is basically an empty class def but somehow executes a bunch of complex stuff via mixins, monkey patches etc, and you have to figure out how.

We are turning to https://sorbet.org/ to reign in the madness. I'm keen to know if others are doing the same, and how they are finding it (pros and cons)

Re:An Introduction to Metaprogramming in Ruby by the-alchemist on Friday July 28, 2023 @09:04AM (#36906191)
How's sorbet? We're looking into it and the webpage looks great, but how's actual usage?
Re:An Introduction to Metaprogramming in Ruby by quechimba on Friday July 28, 2023 @12:34PM (#36909434)
I have used Sorbet in my web framework. The method signatures can be tedious to type out sometimes, but it helps a lot when refactoring code. I feel more confident that my changes will work. It's not as flexible as TypeScript, but it's pretty good and has saved me from mistakes many times. The language server helps a lot with autocompletion so I don't have to keep every little detail in my head all the time. Sometimes I have to structure the code a little bit different just to make Sorbet happy which is annoying, but I've also been able to replace huge parts of the codebase quite easily.