I noticed a program in MSVC with lint options. What are they actually used for, ignoring MSVC warnings? Is it smart to do this?
I noticed a program in MSVC with lint options. What are they actually used for, ignoring MSVC warnings? Is it smart to do this?
A lint program is a sort of code parser that checks many things in your code. It concerns itself with two main things: Syntax-Checking and Code Correctness.
The first is a no-brainer. Your compiler does it. The second is much more interesting and tells you things like if you are placing the const keyword where you should, if you aren't using the canonical forms of some operator overloads, where are you using the so-called magic-numbers, etc...
But lints can do much more than this. They can detect code that can be difficult to port to other systems, classes hierarchies that may be badly defined (DODs, inheritance abuse, copy-control problems etc...), they can detect code that will never run, code that may run forever, integrals that may overflow,... yadda yadda yadda... all the evil things we can do to ourselves and the compiler won't even care.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
Lint is good. It is always wise. [edit]It is often described as, "a syntax checker on steroids."[/edit]
http://en.wikipedia.org/wiki/Lint_programming_tool
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*