Read, understand, and then fix your compiler warnings.
Compiler warnings let you know that you've either done something wrong, or you've done something non-standard. Either way, ignorning compiler warnings shows a lack of discipline and skill; it's something like ignoring big red "warning" signs in real life.
I'm working on a .NET solution that, when last compiled, generated over 60 warning messages. A couple of them I put in to let other developers know about problems I found, but most warned about things that actually needed to get fixed.
For example, the following line of code:
if (comboBox.SelectedItem == "Do stuff")
generated the warning, "Possible unintended reference comparison; to get a value comparison, cast the left hand side to type 'string.'"
In other words, the if statement was evaluating whether the object comboBox.SelectedItem was the same object as the string "Do Stuff," which is an impossibility. So the comparison would always fail, making it look like the feature was failing. Yet the compiler warned the developer about the problem, and even said how to fix it.
If you're wondering, the corrected line looks like this:
if ((string)comboBox.SelectedItem == "Do stuff")
dasBlog theme by Mads Kristensen
All content Copyright ©2010 David Braverman. The Daily Parker by David Braverman is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License, excluding photographs, which may not be republished unless otherwise noted.
Disclaimer David Braverman is the author of this blog and is solely responsible for its content.
Avanade does not control or endorse the content, messages or information found in any public Weblog, and therefore specifically disclaims any liability with regard to this Weblog and any actions resulting from the author's participation in any Weblog.
The ParkerCam may return, but until it does, it's still a good photo of him.