‪Hidden Features of C#

framework logo

Today I was surfing StackOverFlow froum and I faced with an excellent wiki. So I decided to mentioned that in this post. Note that following features are not introduced by me, those are introduced by whom which came after the keyword.

You can also add a new hidden feature to this list, if you missed it, in this list. and it is better to use these feature to improve our programming skills.

You can find the original post here.


GNU Logo

GNU Logo

‪Title : ‪Hidden Features of C#

‪Publish Date : 02/05/2010

‪Version : 2.0

Original ‪Author : [StackOverFlow]

‪Author : Nasser Hadjloo

‪Author Mail : n.hajloo@gmail.com

‪Copyright (c) 2010 Nasser Hadjloo.

‪Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation;

‪with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.


Here are the revealed features so far:



yield by Michael Stum
var by Michael Stum
using() statement by kokos
readonly by kokos
as by Mike Stone
as / is by Ed Swangren
as / is (improved) by Rocketpants
default by deathofrats
global:: by pzycoman
using() blocks by AlexCuse
volatile by Jakub Šturc
extern alias by Jakub Šturc


DefaultValueAttribute by Michael Stum
ObsoleteAttribute by DannySmurf
DebuggerDisplayAttribute by Stu
DebuggerBrowsable and DebuggerStepThrough by bdukes
ThreadStaticAttribute by marxidad
FlagsAttribute by Martin Clarke
ConditionalAttribute by AndrewBurns


?? operator by kokos
number flaggings by Nick Berardi
where T:new by Lars Mæhlum
implicit generics by Keith
one-parameter lambdas by Keith
auto properties by Keith
namespace aliases by Keith
verbatim string literals with @ by Patrick
enum values by lfoust
@variablenames by marxidad
event operators by marxidad
format string brackets by Portman
property accessor accessibility modifiers by xanadont
ternary operator (?:) by JasonS
checked and unchecked operators by Binoj Antony
implicit and explicit operators by Flory

Language Features

Nullable types by Brad Barker
Currying by Brian Leahy
anonymous types by Keith
__makeref __reftype __refvalue by Judah Himango
object initializers by lomaxx
format strings by David in Dakota
Extension Methods by marxidad
partial methods by Jon Erickson
preprocessor directives by John Asbeck
DEBUG pre-processor directive by Robert Durgin
operator overloading by SefBkn
type inferrence by chakrit
boolean operators taken to next level by Rob Gough
pass value-type variable as interface without boxing by Roman Boiko
programmatically determine declared variable type by Roman Boiko
Static Constructors by Chris
Easier-on-the-eyes / condensed ORM-mapping using LINQ by roosteronacid

Visual Studio Features

select block of text in editor by Himadri
snippets by DannySmurf


TransactionScope by KiwiBastard
DependantTransaction by KiwiBastard
Nullable<T> by IainMH
Mutex by Diago
System.IO.Path by ageektrapped
WeakReference by Juan Manuel

Methods and Properties

String.IsNullOrEmpty() method by KiwiBastard
List.ForEach() method by KiwiBastard
BeginInvoke(), EndInvoke() methods by Will Dean
Nullable<T>.HasValue and Nullable<T>.Value properties by Rismo
GetValueOrDefault method by John Sheehan

Tips & Tricks

nice method for event handlers by Andreas H.R. Nilsson
uppercase comparisons by John
access anonymous types without reflection by dp
a quick way to lazily instantiate collection properties by Will
JavaScript-like anonymous inline-functions by roosteronacid


netmodules by kokos
LINQBridge by Duncan Smart
Parallel Extensions by Joel Coehoorn