3 ms·
Interesting that you say that. I come from a very different background but have always that thought type inference hurts the readability of code and should be u
by azhenley 6y ago
Interesting that you say that. I come from a very different background but have always that thought type inference hurts the readability of code and should be used sparingly.
I wrote up the thoughts in a post [1] that seemed to get extreme reactions from both camps [2].
[1] Type inference has usability problems. http://web.eecs.utk.edu/~azh/blog/typeinference.html http://web.eecs.utk.edu/~azh/blog/typeinference.html
[2] HN discussion. https://news.ycombinator.com/item?id=20296123 https://news.ycombinator.com/item?id=20296123
- eru 6y agoCareful, there are multiple ways to use type inference. In practice, many people use type inference when exploring and writing code; but then add explicit annotations for readability and documentation. You could even do the last step automatically.