3 ms·
I like explicit types on functions too. However, it might be what I’m used to. Do you think this would be less of a problem with editor/IDE support? Using co
by melling 6y ago
I like explicit types on functions too.
However, it might be what I’m used to.
Do you think this would be less of a problem with editor/IDE support? Using colors, or other visuals, to infer and show the types while editing might overcome this desire.
- steveklabnik 6y agoRust did not choose to infer types in signatures for UX and stability reasons. If you infer types in signatures, then a change in the body of the function can change the type of the function, which makes dealing with backwards compatibility harder. Also, it leads to weird "errors at a distance."
- kroolik 6y agoI call this property "an accidental complexity" - when changing one piece of code causes failures in other, seemingly unrelated parts of the system. The property causes fear of introducing changes, and is usually a sign of tight coupling.
- skohan 6y agoI tend to agree with the philosophy that a language should not require an IDE to be productive in. With function signatures, I think it's particularly relevant for documentation as well. I should be able to look at a function signature in generated docs and know everything about what goes into and comes out of that function. For me the signature should be a complete contract, and changing code within a function body should not be able to change the signature.