3 ms·
Types are incomplete documentation. They may or may not be sufficient depending on the context. There are some really great things about types as documentatio
by dllthomas 7y ago
Types are incomplete documentation. They may or may not be sufficient depending on the context.
There are some really great things about types as documentation, though:
1) It's machine-checked, so it's probably not out of date or mistaken, which can be worse than no documentation.
2) The interaction with my code is checked, so if I misunderstood the compiler often has my back.
3) With inference, I can often ask for docs for code I just wrote.
None of this is to say that there aren't usually other forms of documentation that should be produced.