3 ms·
I would definitely agree in a typed language, and I see how identifying this "smell" early could be nice in Ruby. However you can do that with validations too a
by ch4s3 4y ago
I would definitely agree in a typed language, and I see how identifying this "smell" early could be nice in Ruby. However you can do that with validations too and get basically the same results. If your validations are overflowing the page, maybe you're doing too much.
For something like Ruby types feel bolted on and for the trouble I'm not sure the payoff is worth it personally.
But this is all just my opinion, clearly a lot of smart folks a Shopify disagree.
- karmakaze 4y agoIt is bolted on, and personally I might not use it either. But at scale it makes a big difference. The other difference is that I can not add a validation and the code passes existing tests and runs. Typecheck won't pass without making the messy longer type sig or writing the untyped smell.
- ch4s3 4y agoI always hear the at scale claim, but have never seen it even in larger code based. The academic literature also seems far from conclusive. I get why people like types, but I think they’re a bit oversold.
- deleted 4y ago[deleted]
- karmakaze 4y agoThe literature I read was about comparable defect rates between different programming languages producing comparable functionality. I hadn't read anything about productivity of different languages and team sizes--if you have any references I'd be interested in reading them. One story I did read was about how Twitter switched to Scala (and later Java IIRC) mainly for the static typing and not for performance or other reasons. I don't understand the not seeing it in a large codebase point. I work on a large Ruby code base that started without type annotations. Since I joined, we're now all adding type annotations for everyone's benefit, so they definitely exist. The reason for not wholly rewriting such a large codebase in a static typed language should generally be considered a no go. Many devs complained at the time and now most (if not all, I don't know of exceptions) now appreciate having the type checking and visible annotations for reading. I don't work on front-end but I expect that there was a some of that too in the React TypeScript codebases.