News for hackers. Stuff that matters.
Re:Implement with Types, Not Your Brain by dllthomas on Tuesday June 25, 2019 @09:46PM (#20281166)
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.

There are no comments on this comment yet.