top | item 46385653

(no title)

__float | 2 months ago

I work in a large Sorbet codebase (though it isn't a Rails one) and it's a huge boon IMO. The number of tests we don't need to write because of Sorbet is really nice.

It does occasionally require structuring your code differently, but I find the type-system-encouraged approach often gives a more elegant and harder-to-misuse interface in the end.

discuss

order

prh8|2 months ago

You work in a large Ruby codebase that _isn't_ Rails?! Are you hiring??

ezekg|2 months ago

I was assuming Stripe, but would love to hear of others!

zingar|2 months ago

Very curious to hear about the specific cases where types make tests unnecessary.

I spend my working life swapping between Ruby and typescript projects and the typescript project is utter garbage with poor test coverage that needs a day of human QA for every build whereas the Ruby project is well tested such that we know that CI passing means it’s good to be released.

qaisjp|2 months ago

Types don't make testing in general unnecessary, but it removes a class of error handling that runtime type checking handles for you. You can really trust the types when using Sorbet.

(I also work in a 40m+ loc non-rails ruby codebase that is almost entirely typed with Sorbet.)