Must read on Static / Shared

One of my all time favorites when I take interviews is to ask questions on static variables. I find that many programmers tend to over use the Shared functionality without having a clear understanding of the pros and cons.

To me the biggest disadvantage is that static methods lose polymorphic behavior.

There is really not that much overhead in creating instances of a class.
Did you know that classes can be marked as static in 2.0?

Here is a excellent article that appeared in the January version of MSDN magazine. This article walks you through the details of static variables.


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your 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 )

Connecting to %s