It makes sense when you want to do something like:
public static extension class string
public static string Longest(string s1, string s2)
if (s1 == null)
if (s2 == null)
return s1.Length >= s2.Length ? s1 : s2;
public static extension struct float
public static float FromPcm16(Int16 srcBuffer)
var dstBuffer = new float[srcBuffer.Length];
// Convert to float...
You misunderstood the example."wordCount" is not a field, it is a local variable inside the method (or property) that is used to calculate the number of words. That is why I specifically said you will get a compiler error if you try to add field members. I'll edit the example to make it more clear.