Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <a href="http://rads.stackoverflow.com/amzn/click/0321545613" rel="nofollow noreferrer">Framework Design Guidelines</a> advice you not to do this. However, these guidelines are especially for frameworks, so if you find it very useful in your (line of) business application, please do so.</p> <p>But please be aware that adding these extension methods on object might clutter IntelliSense and might confuse other developers. They might not expect to see those methods. In this case, just use old fashion static methods :-)</p> <p><hr/> One thing I personally find troubling about sprinkling extension methods everywhere it that my CPU (my brain) is trained to find possible <code>NullReferenceException</code>s. Because an extension method looks like an instance method, my brain often receives a <code>PossibleUseOfNullObject</code> interrupt by the <em>source code parser</em> when reading such code. In that case I have to analyze whether a <code>NullReferenceException</code> can actually occur or not. This makes reading through the code much harder, because I'm interrupted more often.</p> <p>For this reason I’m very conservative about using extension methods. But this doesn’t mean I don’t think they’re useful. Hell no! I've even written <a href="https://condition.codeplex.com" rel="nofollow noreferrer">a library for precondition validation</a> that uses extension methods extensively. I even <a href="https://cuttingedge.it/blogs/steven/pivot/entry.php?id=57" rel="nofollow noreferrer">initially defined extension methods</a> on <code>System.Object</code> when I started writing that library. However, because this is a reusable library and is used by VB developers I decided to remove these extension methods on <code>System.Object</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload