Recently, I had a debate with one of my friends on using type inference in C# (var
keyword). His argument was that we should stick to using the explicit type names because "even with the meaningful variable names, explicit type names enhance readability of the code".
I do agree that it enhances readability but any modern IDE (like Visual Studio and Rider in this case) comes with type hints which show the type names of the type inferred variables which makes no difference between using explicit type names and implicitly typed variables from reader's point of view unless he is using something like Notepad or hardcopies of the code.
But his counterargument was that we should not depend on IDE/Text editor features when choosing a coding style because "We code for the humans to read, so we should not depend on one or two "tools we are using" when deciding our coding styles and conventions."
Is his point correct? I do not have a problem between choosing implicit or explicit typing or maintaining consistency of our coding practices, but not considering the "tools" we use when deciding the coding styles sounds too much.
.editorconfig
. Any time wasted beyond that in some form of debate is better spent ensuring the tooling is taking care of it, and also writing tests.var
? Where do I get this, I will install it immediately.