5 ReSharper settings for C#4 coding

Sometimes, it is the small things that make you feel good or bad when programming. I personally find it disgusting to see code like this:

image

Oh my god. I was afraid I’d need two monitors just for Visual Studio to see the full source code when something like this comes along:

image

… but fortunately ReSharper came to the rescue and automatically wrapped the long lines, phew!

Long story short, here are my top 5 ReSharper settings:

SNAGHTML39f8c98

Change them both from “At next line indented 2 (GNU style)” to “At next line (BSD style)”.

Then, we have these two:

image

Check them off and you’ll be better.

And here is the last one:

SNAGHTML3a59e82

This guy force you to hit backspace twice after each completion in order to remove the two unnecessary parentheses. I’m not 100% sure if I like this setting turned off since it effects many other situations as well, where I’d actually want to have them inserted.

Do you have any other must-have R# settings that everyone should know?

Update: As Carsten suggested in the comment below, here is the resulting picture. Much cleaner, isn’t it?

image

3 Responses to 5 ReSharper settings for C#4 coding

  1. Carsten January 27, 2012 at 06:16 #

    Hi,
    very nice post – didn’t know some of the settings above – but while reading I somewhat missed the “and the result is”-picture. Maybe you can add those, so people can see the resulting format?

    • Daniel Lang January 27, 2012 at 06:23 #

      Thank you for the hint. Updated the post to include the result. :)

  2. Matt Warren January 27, 2012 at 11:39 #

    Wow, why did I never think of doing this. The way ReSharper formats/indents object initialisers is one of the few things that annoys me about it.

    Cheers for doing this post

Leave a Reply