News for hackers. Stuff that matters.
Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by danmaz74 on Thursday June 20, 2019 @06:49PM (#20238183)
Nowadays I write unit tests for any nontrivial code I create. It takes a little more time than writing type declarations, but IMHO they offer much more value.
Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by tptacek on Thursday June 20, 2019 @07:04PM (#20238304)
Unit tests are great, but they're a stupid way to catch typos.
Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by danmaz74 on Friday June 21, 2019 @03:17AM (#20240576)
I agree that writing them only to catch typos would be stupid. But if you're going to write them regardless, catching typos comes for free.

Ps and luckily, even with dynamic languages any decent IDE will catch most typos

Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by dragonwriter on Thursday June 20, 2019 @07:50PM (#20238626)
> Unit tests are great, but they're a stupid way to catch typos.

Catching typos is an important part of what unit tests do with statically typed code, since typos result in value errors at least as often as type errors.

Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by tptacek on Thursday June 20, 2019 @07:57PM (#20238668)
That’s obviously true, but it’s equally obvious that there’s a whole (large) class of typos that types eliminate.