Stripe has open sourced Sorbet, our Ruby type checker: https://sorbet.org/blog/2019/06/20/open-sourcing-sorbet … I will probably adopt this in all future Ruby projects. Here’s why:
-
-
One, most projects that I’ve worked on do have a core where correctness is very important, reasoning about what the code is doing is the majority of the effort, and changes are made with care. That core is often fuzzily defined.
Show this thread -
The mechanics you’ll need to type check the core will generally force it to have good interfaces, something which Ruby does not encourage by default. You’ll find it’s easier to type check if you refactor sanely; the code will *get better* as you do this.
Show this thread -
Two, optional type checking lets you continue using, or drop into using, untyped code in places where you’re just doing trivial string munging and where typechecking generally provides relatively little value. (Thin controllers and views, in my experience, don’t need much.)
Show this thread -
Type checking catches bugs that unit testing does not, often much faster and with less code overhead than unit testing requires. It has surprised me how much of my unit tests were de facto implementing a type system halfheartedly as opposed to testing behavior of those types.
Show this thread -
My enthusiasm for this project is extremely high; it’s perceptibly the best upgrade to writing Ruby code I’ve experienced since starting with Ruby in 2008. We are quite invested in Ruby. If you’d also like working on this:https://stripe.com/jobs
Show this thread
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.