Hacker News new | past | comments | ask | show | jobs | submit login

Related: static typing is itself documentation (low-cost, machine-checked documentation).



Yes, but mostly this type of documentation: http://photos1.blogger.com/blogger2/1715/1669/1600/larson-oc...


When 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.


Fortunately, your IDE can use inference to add a type signature with a keystroke.


And now you've added the cost of mandating an IDE, and someone has to write that feature for the IDE in the first place.


The feature exists in emacs and vim, and is nice but not mandatory.

It should be easy to integrate into any editor.


"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.


> 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).


> 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.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: