variables

properties

Properties vs. Public Variables

I occasionally see code with properties like this: private int name; public int Name {     get { return name; }     set { name = value; } } As I see it, there are three things to consider here. 1. When is a property not a property? When it's a glorified public variable. Why waste everyone&

By Jeff Atwood ·
Comments

performance

For Best Results, Don't Initialize Variables

I noticed on a few projects I'm currently working on that the developers are maniacal about initializing variables. That is, either they initialize them when they're declared: private string s = null; private int n = 0; private DataSet ds = null; Or they initialize them in the constructor:

By Jeff Atwood ·
Comments