Skip to main content
added 7 characters in body
Source Link
Doc Brown
  • 220.3k
  • 35
  • 410
  • 623

"Type hints" are a very weak argument for "var", because they appear only when one places the mouse cursor over the var keyword. But when reading code, any professional developer processes whole lines and sections of code at once, without hovering the cursor from one var to another to find out the type (and remember it when the mouse is moved away). Hence I disagree with your idea that it makes no difference ... from reader's point of view - usage or non-usage of var has a significant influence on the readability, even in a powerful IDE like Visual Studio.

Does that mean one should not use var, like your friend suggested? Well, this debate has already taken place years ago, on this site and elsewhere. The gross consensus is, there are several cases where usage of the "var" keyword does not make the code less readable, and several cases where it can actually enhance readability (of course, wrong usage of var can also reduce readability, that is also true). 

Look into the older Q&A threads about this topic, like this one, or this similar Q&A about C++ and the auto keyword. None of the arguments in the accepted answers (and several other answers) mentions the IDEIDE's capabilities as an argument for var. So if you are going to argue for usage of "var", there are way better arguments than the availability of type hints in the IDE.

"Type hints" are a very weak argument for "var", because they appear only when one places the mouse cursor over the var keyword. But when reading code, any professional developer processes whole lines and sections of code at once, without hovering the cursor from one var to another to find out the type (and remember it when the mouse is moved away). Hence I disagree with your idea that it makes no difference ... from reader's point of view - usage or non-usage of var has a significant influence on the readability, even in a powerful IDE like Visual Studio.

Does that mean one should not use var, like your friend suggested? Well, this debate has already taken place years ago, on this site and elsewhere. The gross consensus is, there are several cases where usage of the "var" keyword does not make the code less readable, and several cases where it can actually enhance readability (of course, wrong usage of var can also reduce readability, that is true). Look into the older Q&A threads about this topic, like this one, or this similar Q&A about C++ and the auto keyword. None of the arguments in the accepted answers (and several other answers) mentions the IDE capabilities as an argument for var. So if you are going to argue for usage of "var", there are way better arguments than the availability of type hints in the IDE.

"Type hints" are a very weak argument for "var", because they appear only when one places the mouse cursor over the var keyword. But when reading code, any professional developer processes whole lines and sections of code at once, without hovering the cursor from one var to another to find out the type (and remember it when the mouse is moved away). Hence I disagree with your idea that it makes no difference ... from reader's point of view - usage or non-usage of var has a significant influence on the readability, even in a powerful IDE like Visual Studio.

Does that mean one should not use var, like your friend suggested? Well, this debate has already taken place years ago, on this site and elsewhere. The gross consensus is, there are several cases where usage of the "var" keyword does not make the code less readable, and several cases where it can actually enhance readability (of course, wrong usage of var can also reduce readability, that is also true). 

Look into older Q&A threads about this topic, like this one, or this similar Q&A about C++ and the auto keyword. None of the arguments in the accepted answers (and several other answers) mentions the IDE's capabilities as an argument for var. So if you are going to argue for usage of "var", there are way better arguments than the availability of type hints in the IDE.

added 42 characters in body
Source Link
Doc Brown
  • 220.3k
  • 35
  • 410
  • 623

"Type hints" are a very weak argument for "var", because they appear only when one places the mouse cursor over the var keyword. But when reading code, any professional developer processes whole lines and sections of code at once, without hovering the mouse cursor from one var to another to find out the type (and remember it when the mouse is moved away). Hence I disagree with your idea that it makes no difference ... from reader's point of view - usage or non-usage of var has a significant influence on the readability, even in a powerful IDE like Visual Studio.

StillDoes that mean one should not use var, like your friend suggested? Well, this debate has already taken place years ago, on this site and elsewhere. The gross consensus is, there are several cases where usage of the "var" keyword does not make the code less readable, and several cases where it can actually enhance readability. Most (of course, wrong usage of those cases were discussed in a fewvar can also reduce readability, that is true). Look into the older Q&AsQ&A threads about this topic, like this one, or in this similar Q&A about C++ and the auto keyword. None of the arguments in the accepted answers (and several other answers) mentions the IDE capabilities, so as an argument for var. So if you are going to argue for usage of "var", there are way better arguments than the availability of type hints in the IDE.

"Type hints" are a very weak argument for "var", because when reading code, any professional developer processes whole lines and sections of code at once, without hovering the mouse cursor from one var to another to find out the type. Hence I disagree with makes no difference ... from reader's point of view - usage or non-usage of var has a significant influence on the readability, even in a powerful IDE like Visual Studio.

Still there are several cases where usage of the "var" keyword does not make the code less readable, and several cases where it can actually enhance readability. Most of those cases were discussed in a few older Q&As, like this one, or in this similar Q&A about C++ and the auto keyword. None of the arguments in the accepted answers (and several other answers) mentions the IDE capabilities, so if you are going to argue for usage of "var", there are better arguments than the availability of type hints.

"Type hints" are a very weak argument for "var", because they appear only when one places the mouse cursor over the var keyword. But when reading code, any professional developer processes whole lines and sections of code at once, without hovering the cursor from one var to another to find out the type (and remember it when the mouse is moved away). Hence I disagree with your idea that it makes no difference ... from reader's point of view - usage or non-usage of var has a significant influence on the readability, even in a powerful IDE like Visual Studio.

Does that mean one should not use var, like your friend suggested? Well, this debate has already taken place years ago, on this site and elsewhere. The gross consensus is, there are several cases where usage of the "var" keyword does not make the code less readable, and several cases where it can actually enhance readability (of course, wrong usage of var can also reduce readability, that is true). Look into the older Q&A threads about this topic, like this one, or this similar Q&A about C++ and the auto keyword. None of the arguments in the accepted answers (and several other answers) mentions the IDE capabilities as an argument for var. So if you are going to argue for usage of "var", there are way better arguments than the availability of type hints in the IDE.

added 42 characters in body
Source Link
Doc Brown
  • 220.3k
  • 35
  • 410
  • 623

"Type hints" are a very weak argument for "var", because when reading code, any professional developer processes whole lines and sections of code at once, without hovering the mouse cursor from one var to another to find out the type. Hence I disagree with makes no difference ... from reader's point of view - usage or non-usage of var has a significant influence on the readability, even in a powerful IDE like Visual Studio.

Still there are enoughseveral cases where usage of the "var" keyword does not make the code less readable, quite the oppositeand several cases where it can actually enhance readability. Most of those cases were discussed in a few older Q&As, like this one, or in this similar Q&A about C++ and the auto keyword. None of the arguments in the accepted answers (and several other answers) mentions the IDE capabilities, so if you are going to argue for usage of "var", there are better arguments than the availability of type hints.

"Type hints" are a very weak argument for "var", because when reading code, any professional developer processes whole lines and sections of code at once, without hovering the mouse cursor from one var to another to find out the type. Hence I disagree with makes no difference ... from reader's point of view - usage or non-usage of var has a significant influence on the readability, even in a powerful IDE like Visual Studio.

Still there are enough cases where usage of the "var" keyword does not make the code less readable, quite the opposite. Most of those cases were discussed in a few older Q&As, like this one, or in this similar Q&A about C++ and the auto keyword. None of the arguments in the accepted answers (and several other answers) mentions the IDE capabilities, so if you are going to argue for usage of "var", there are better arguments than the availability of type hints.

"Type hints" are a very weak argument for "var", because when reading code, any professional developer processes whole lines and sections of code at once, without hovering the mouse cursor from one var to another to find out the type. Hence I disagree with makes no difference ... from reader's point of view - usage or non-usage of var has a significant influence on the readability, even in a powerful IDE like Visual Studio.

Still there are several cases where usage of the "var" keyword does not make the code less readable, and several cases where it can actually enhance readability. Most of those cases were discussed in a few older Q&As, like this one, or in this similar Q&A about C++ and the auto keyword. None of the arguments in the accepted answers (and several other answers) mentions the IDE capabilities, so if you are going to argue for usage of "var", there are better arguments than the availability of type hints.

added 123 characters in body
Source Link
Doc Brown
  • 220.3k
  • 35
  • 410
  • 623
Loading
added 203 characters in body
Source Link
Doc Brown
  • 220.3k
  • 35
  • 410
  • 623
Loading
Source Link
Doc Brown
  • 220.3k
  • 35
  • 410
  • 623
Loading