3 ms·
Having been a professional OCaml developer, a long time ago, I found out that too much type inference gets into the way of proper documentation and, to some ext
by Yoric 4y ago
Having been a professional OCaml developer, a long time ago, I found out that too much type inference gets into the way of proper documentation and, to some extent, proper naming conventions. Once code stabilized, we started annotating everything, as in languages with much more limited support for type inference, because it made finding type-level (and sometimes runtime) issues easier.
Perhaps that's the GP is referring to?
- tialaramex 4y agoI'm comfortable with Rust's choice to infer types only within a function, OCaml does sound like it has too much inference. But I think the GP was just confused about vocabulary and what they're really talking about is coercion and they originally wrote "minimal type inference" instead of "minimal type coercion". I think they subsequently corrected to "minimal implicit type conversions" which, is basically just more words for the same thing. Unwanted type coercions are an infamous problem in C and C++.