Wednesday, May 11, 2011

Lowercase Lambdas in an Uppercase World

While I use upper camel case across the board in my development as mentioned in this post. There is an exception and that is with the use of lamdas. Now, I'm not sure as of what version, but at least Resharper 5.1.3 can enforce lower case naming.

1) In Visual Studio click Resharper > Options

2) In the Options dialog select C# Naming Style

3) Select Override common settings. The custom naming rule for lamdas doesn't exist in the common naming styles.

4) Click Advanced settings

5) Click Add, which wil bring up



The two critical options to select are the Lambda parameter in the Affected Entities listbox and the all_lower option under Name Style. Et Viola! You will no longer get squiggles under your lambdas.

Drop the Hungarian Leftovers

It might seem a little absurd to you, but my Resharper naming conventions are configured like this.



That's right. I don't prepend 'I' to interfaces, use camelcase for local variables, underscores on private members. I use none of those Hungarian leftovers. On top of that I don't prefix user controls with lbl, txt or drp etc. I don't think any of it is needed. Do you? Why?