@Jared:
Non-overloaded, non-inherited static methods (like Class.b(a,c)) that take an instance as the first variable are semantically equivalent to a method call (like a.b(c))
No, they aren't.
(Assuming it compiles to the same CIL, which it should.)
That's your mistake. The CIL produced is different. The distinction is that member methods can't be invoked on null
values so the CIL inserts a check against null
values. This obviously isn't done in the static variant.
However, String.Format
does not allow null
values so the developers had to insert a check manually. From this point of view, the member method variant would be technically superior.