Thursday September 3rd

Tuesday September 1st

Monday August 31st

Rarely used C# Keywords

When doing code reviews or when working with code that was developed by someone else, once in a while I come across keywords that are rarely used. Some of them are forgotten keywords that are not considered a good practice and hence are not promoted by the community. Some of them could be handy and efficient but they never made it to the limelight.

4 comments

@dncdude: you deserve kick.
:D

Rarely used?? The "using" keyword should be used frequently by anybody dealing with disposable resources. And the rest aren't even keywords: (yield is a contextual keyword, which anyone using a functional style will use frequently, ?? is an operator, @ is syntax, and ForEach is a method!

If you're not familiar with the "keywords" (most of which aren't even keywords, but whatever) then you should become more familiar with them. With exception to the ForEach() method (which I personally don't like), I use almost every one of these almost daily. A using statement is especially necessary.

My mistake. Didn't read the wording around @ and assumed you were talking about C# strings that are not escaped. But that would be a naming rule. It certainly isn't a keyword.

Commenting on Stories is limited for now and will open up to those recommended by the community. Learn how
Loading DotNetKicks...
brought to you by the Kicks Network