4 ms·
For me: - Ease of refactoring once the project got to a certain size. - Preventing a lot of my stupid bugs (typos, passing the wrong type etc.). - Quicker an
by panzi 4y ago
For me:
- Ease of refactoring once the project got to a certain size.
- Preventing a lot of my stupid bugs (typos, passing the wrong type etc.).
- Quicker and easier understanding of argument and return types. The types are a form of documentation!
- Auto-completion and inline docs for library functions.
- Fewer tests needed, since everything the type system does has to otherwise be tested by a manually written test.
Just things anyone would tell you that appreciates static typing.
- ch4s3 4y agoI’ve worked on some pretty large codebases and while there’s usually no IDE button for it, there are good and well known patterns for refactoring dynamic code. As for bugs, the research on this has always been mixed at best, I guess YMMV. I’d personally argue that the structural typing in Elixir is more useful and practical than the types in most popular static languages like Java or TS. Mostly I think it’s a wash where you get a little but give up some useful things too.