Occasionally I see questions about edge cases and other weirdness on Stack Overflow that are easily answered by the likes of Jon Skeet and Eric Lippert, demonstrating a deep knowledge of the language and its many intricacies, like this one:


  You might think that in order to use a foreach loop, the collection
  you are iterating over must implement IEnumerable or IEnumerable<T>.
  But as it turns out, that is not actually a requirement. What is
  required is that the type of the collection must have a public method
  called GetEnumerator, and that must return some type that has a public
  property getter called Current and a public method MoveNext that
  returns a bool. If the compiler can determine that all of those
  requirements are met then the code is generated to use those methods.
  Only if those requirements are not met do we check to see if the
  object implements IEnumerable or IEnumerable<T>.


That's cool stuff to know.  I can understand why Eric knows this; he's on the compiler team, so he has to know.  But what about those who demonstrate such deep knowledge who are not insiders? 

How do mere mortals (who are not on the C# compiler team) find out about stuff like this? 

Specifically, are there methods these folks use to systematically root out such knowledge, explore it and internalize it (make it their own)? 

First off, thanks for the kind words.

If you want to get a deep knowledge of C# it is undoubtedly an advantage to have the language specification, ten years of design notes, the source code, the bug database, and Anders, Mads, Scott and Peter just down the hall. I'm certainly fortunate, no question about it.

However, even without those advantages it is still possible to get a deep knowledge of the subject. 

Back when I started at Microsoft I was working on the JScript interpreter that shipped with Internet Explorer 3. My manager at the time told me something that was some of the best advice I've ever gotten. He said that he wanted me to become the recognized expert at Microsoft on the syntax and semantics of the JScript language, and that I should go about this by seeking out questions on those aspects of JScript and answering them. Particularly answering the questions I didn't know the answers to, because those are the ones I would learn from.

Obviously StackOverflow and other public Q&A forums are like drinking from a firehose for that sort of thing. Back then, I read comp.lang.javascript and our internal Microsoft "JS User" forums religiously and followed my manager's advice: when I saw a question that was about the language semantics that I didn't know the answer to, I made it my business to find out.

If you want to do a "deep dive" like that, you've got to choose carefully. I to this day am remarkably ignorant of how the browser object model works. Since I have been concentrating on becoming the C# language expert these last years, I am remarkably ignorant of how the various classes in the base class libraries work. I am fortunate in that I have a job that prizes specific deep knowledge; if your job or your talents are more in line with being a generalist, going deep might not work for you.

Writing a blog is also tremendously helpful; by requiring me to explain complex topics to other people, I am forced to confront my own inadequate understanding of various topics all the time.
