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:
-
-
Ruby test suites, particularly in large projects, do not execute fast enough to use them in this feedback loop. Sorbet type checking does. If you have forgotten that an internal service expects a User not their email address you’ll learn that about the same time you close the )
Show this thread -
Sorbet is, unlike most language-level type systems, designed for the reality that the supermajority of your Ruby code (including that inherited from the ecosystem) is untyped. You can upgrade-in-place a project gradually to create a typed core. This has felt enormously powerful.
Show this thread -
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 -
-
-
Not sure if this is possible, but can you eli5 why golang is so much faster at this than other languages?
#codenewbieThanks. Twitter will use this to make your timeline better. UndoUndo
-
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.