3 ms·
One thing which I don't often see mentioned is that when you refactor (e.g. rename a type), with type inference less code is changed therefore fewer git diff "h
by adrianmsmith 7y ago
One thing which I don't often see mentioned is that when you refactor (e.g. rename a type), with type inference less code is changed therefore fewer git diff "hunks". That means easier merging.
For example:
var thing = getThing();
processThing(thing);
If you rename the type that getThing() returns, for example from "Thing" to "TheThing", without type inference the above code has to change (the type of "thing" has changed); with type inference no characters in the source code are changed.
If somebody else makes a change to those lines, e.g. writes the whole block in an "if" statement indenting it, without type inference you now have a merge conflict you have to resolve. With type inference, merging works without manual conflict resolution.