Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

IDE text formatting

Is there a way to change the C# formatting from the bad

if (blah, blah, blah)
{
    some code here;
}

to the superior

if (blah, blah, blah)
    {
    some code here;
    }

This used to be an option in the old IDE, but they seem to have done away with in in VS.NET.

Clutch Cargo
Monday, July 19, 2004

The use of the words "bad" and "superior" are great. Keep up the humor. :)

Brad Wilson (dotnetguy.techieswithcats.com)
Monday, July 19, 2004

Not in 2003. You could use ReSharper if you urgently want to destroy your Visual Studio installation, though. Visual Studio 2005 Beta has all the options you need to uglify your source code at will.

Chris Nahr
Tuesday, July 20, 2004

This, of course, is the worst option:

if (blah, blah, blah) {
    some code here;
}

In my (vast) experience it is used exclusively by programmers who fundamentally don't understand the basics of block structured programming languages.

Clutch Cargo
Tuesday, July 20, 2004

I have to say, I prefer the default option that the o/p describes as "bad". It just looks right.

Steve Jones (UK)
Tuesday, July 20, 2004

I share CC's preferences.  But I don't care if others prefer alternate bracket placement.  What irritates is IDE programmers who force their own preferences on others by not making the full range of options available.

Like Joel says, the problem is forcing people to make choices they don't care about; but bracket placement is something people _do_ care about.

Kyralessa
Tuesday, July 20, 2004

Clutch Cargo is clearly living in an alternate universe where good is evil and up is down. Writing the opening brace after the block initiation statement is by far the best style, making a curly-braces language almost as beautiful as Python, and will be put into law the day I'm appointed galactic dictator.

Chris Nahr
Wednesday, July 21, 2004

*  Recent Topics

*  Fog Creek Home