You're not always going to be looking at code through an IDE, though (i.e. if I'm looking at a code review on GitHib, which honestly makes up a lot of my time spent), and for large projects, the indexing that makes that happen can be painfully slow and sluggish to use (I'm looking at you, Eclipse). And either way, it's always going to be better for readability if the information I need is right there on the screen for you, not hidden behind clicks and interaction with the IDE.
Its a continuum of how much information is hidden without going to the implementation. A lot of the time knowing the type won't help that much anyway. So:
are equally obscure without going to the definition if you aren't already familiar with the code. I find it to be the exception not the rule that the implicit declaration is what makes the code unclear.
With the explicit type I only have to know what a CustomerValidationResponse is.
No, because it might return a type that is implicitely convertible to CustomerValidationResponse and where the conversion has side-effects. So you still have to check it, while in the var case you know that the variable is of the type of the return of the function.
10
u/lamarf Mar 09 '16
You're not always going to be looking at code through an IDE, though (i.e. if I'm looking at a code review on GitHib, which honestly makes up a lot of my time spent), and for large projects, the indexing that makes that happen can be painfully slow and sluggish to use (I'm looking at you, Eclipse). And either way, it's always going to be better for readability if the information I need is right there on the screen for you, not hidden behind clicks and interaction with the IDE.