I was shocked to find out this morning that Visual Studio 2005 did something I don’t like.
It made :
Foo f = new Foo( "bar" );
Into:
Foo f = new Foo("bar");
You may not notice the difference, but I do. I’m a big fan of style, mainly because I like clean looking code.
For the same reason, I don’t like {}’s on new lines. If you say it helps readability, then I will argue that your methods are too long. Nothing itches me the wrong way as something like:
public String FirstName
{
set
{
if ( firstName == null )
{
firstName = "";
}
else
{
firstName = value;
}
}
get
{
return firstName;
}
}
Since I’m on the soapbox, I think I’ll continue on.
I like to use my accessors even inside the class they are defined in. You have accessors so consumers don’t hose themselves. For the same reason you should pass that theory to the class. Relatedly, I don’t like prepending class variables with m_ (ie: use the accessor).
You can probably guess that I’m not a fan of Hungarian Notation. My main beef with it is, why should you care? If you have good names, you should get the idea (I’ll admit an exception when dealing with UI compnents. I personally find it useful to have something like ddlFunctions to give you an idea that it is a DropDownList, however again, if you do a context switch in your head that you’re in UI land, then a decent name should suffice).
I also don’t like method arguments prepended with an identifier so you know if it is a method var or a class var. (see above Accessor argument)
I don’t like XP (mainly because I get to twitchy when people don’t drive like I do, however I like XD (extreme debugging)), and I can’t say I’m a big fan of TDD either (perhaps because it feels like you’re putting all of your eggs in one basket)
I like “coding by intent”, short methods, good naming conventions, cohesion, loose coupling, testing your code when needed, and a handful of patterns.
Where did I develop all of my dogmatic views? A big influence comes from learning all the good habits from Dave. Reading Steve, and Martin and I suppose just me.
To get back to the original thread of dicussion, you can thankfully make the spaces stay, if you dig into the options. Tools->Options->Text Editor->C#->Formatting->Spacing.