c# – some must-know but seldom used features#le2YH

(Blog post. No need to reply.)

Hi YH,

Sharing some recent experience. In any language, the features we need to use is a tiny portion of the language feature set. Many of these features are designed for robust, high-performance, exception-safe coding but most applications have no such requirement.

However, As an experienced c# coder, we need to know enough to carry a intelligent discussion with other veterans on these topics. Otherwise we look like fake:)

* unsafe code
* p/invoke
* reflection on Generic type
* custom attributes (like java annotation)
* expression tree
* dynamic keyword
* closures
* linq to objects
* linq group-by
* GC intricacies
* Dispose vs Finalizer. When to use
* empty throw; vs throw ex;
* new MyStruct()
* SafeHandle
* interlocked
* override ToString() for a custom MyStruct
* wait/pulse
* synchronization context

All of the above features I didn’t need in my c# programming. However, I did go out of my way to explore c#, and managed to use these useful constructs
* generic type constraints
* submit a task to thread pool
* wait handles

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s