6 ms·
I'm going to have to disagree here. The return type is part of the contract for what a method does. Changing it is just as dangerous as changing the type on a
by cogman10 6y ago
I'm going to have to disagree here.
The return type is part of the contract for what a method does. Changing it is just as dangerous as changing the type on a method parameter.
I agree that using type inference locally is a boon to productivity. I disagree that it's a negative for a method return parameter.
Keeping it fixed prevents a future refactor from breaking the method expectations and contracts down the line.