Dr Herbie said:Well, without the extension method language feature, you'd have to use the decorator pattern. If you only want to add a single method, that's potentially an awful lot of work, which is why I like extensions.dahat said:*snip*
For me the real strength of extension methods is in adding type-inferenced extension methods to interface, so that classes inheriting that interface automatically get interface-related functionality for free (we discussed this a while ago over on this thread).
Herbie
In regards to extension methods being confusing, I agree in that extension methods are extraordinarily powerful and thus have dramatic potential for misuse. However there are a few cases such as adding context specific methods to base objects like object or string or adding methods to a system interface like IList where they are the best way to perform the move.
That being said it is sad that extension properties, which seem to me to be no more or less powerful or appropriate than extension methods were not included simply because an agreement on the declaration syntax could not be reached.

Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.