Tip of the Day: Analyze Your Code
These days there are some great tools available for improving the quality of your code. Two such tools available from Microsoft are PREfast and FxCop. These tools are static analysis tools which look for provably wrong coding patterns. PREfast analyzes C/C++ source code and FxCop analyzes managed code binaries. Both tools are shipped with the Visual Studio Team Systems products.
And PREfast is also shipped with the Windows SDK. But before you install the SDK and start looking for an “exe” for PREfast, let me clarify that it’s actually implemented as the /analyze compiler switch (which leads one to wonder why doesn’t this ship with all VS products…).
If you’re wondering if it’s worth your effort to use these tools, I can attest from personal experience that they do find significant bugs which would be difficult to find without them. If your still not sold (hey, who would on my word?) I suggest you read this great blog article written by the VS C++ team on PREfast and SAL (more to come on that later).