Hacker News new | ask | show | jobs
by theonething 333 days ago
The thing is most useful for me about types is it serves as forced documentation. I look at function signature with types and know what kinds of values it accepts and what it returns.
1 comments

For sure. The biggest advantages of static types I see is the better tooling + faster feedback for type errors. They're advantaegs but not that big of a deal and they're equal to the tradeoffs you're making to where it doesn't matter much

I see dynamic codebases being written differently though. We all know those tradeoffs - so conventions pop up to deal with them. A method that ends in a ? in ruby - like user.admin? - always returns a boolean. You get better at naming to make types clearer

I definitely miss the perfect automated refactorings though