3 ms·
Related: static typing is itself documentation (low-cost, machine-checked documentation).
by hyp0 13y ago
Related: static typing is itself documentation (low-cost, machine-checked documentation).
- brudgers 13y agoWhen the static type checking system has an inference engine there is a strong incentive not to document types on the part of programmers. Conversely, a requirement that for explicit type declarations makes the use of generics more cumbersome.
- Peaker 13y agoFortunately, your IDE can use inference to add a type signature with a keystroke.
- steveklabnik 13y agoAnd now you've added the cost of mandating an IDE, and someone has to write that feature for the IDE in the first place.
- Peaker 13y agoThe feature exists in emacs and vim, and is nice but not mandatory. It should be easy to integrate into any editor.
- steveklabnik 13y ago"It should be easy to integrate" is the downfall of many a software developer. Anyway, my point is not that it's difficult or bad: it's that it's has _some_ cost.
- Dewie 13y ago> When the static type checking system has an inference engine there is a strong incentive not to document types on the part of programmers. But then the compiler has the capacity to write/emit the type declarations.
- mercurial 13y ago> When the static type checking system has an inference engine there is a strong incentive not to document types on the part of programmers. Not the case in Haskell, at least. Most Haskell code out uses type signatures. > Conversely, a requirement that for explicit type declarations makes the use of generics more cumbersome. True enough, but you can't have your cake and eat it. Either you want explicit documentation-by-types, which has a cost, or you don't (which also has a cost in terms of maintenance).
- krupan 13y agoYes, but mostly this type of documentation: http://photos1.blogger.com/blogger2/1715/1669/1600/larson-oct-1987.gif http://photos1.blogger.com/blogger2/1715/1669/1600/larson-oc...