tags:

views:

189

answers:

6

Today I found out about an interface I'd never heard of before: IGrouping

IEnumerable<IGrouping<YourCategory, YourDataItem>>

I am fortunate to have access to some of the best programming books available, but seldom do I come across these kinds of gems in those books. Blogs and podcasts work, but that approach is somewhat scattershot. Is there a better way to learn these things, or do I need to sift through the entire MSDN library to discover them?

+5  A: 

The best place to start is Jon Skeet's C# Coding blog: http://msmvps.com/blogs/jon_skeet/

He regularly covers stuff you won't see anywhere else.

Mark Brittingham
Although there's often a very good reason you won't see them anywhere else :)
Jon Skeet
Actually, the thing I'm most amazed about is that I beat you to the answer on this one...
Mark Brittingham
Obviously, Jon let you win so he wouldn't have to toot his own horn.
Steven Sudit
@Mark: Jon probably just waited until someone had posted a link to his blog. That way it's in the first answer, but without self-promotion. Clever move, I would say ;o)
Fredrik Mörk
You know, you're probably right. Just can't overestimate the cleverness of this guy, eh?
Mark Brittingham
+3  A: 

How about the Hidden Features series of questions?

Hidden Features of C#

Hidden Features of ASP.NET

And many more...

Matthew Jones
I know about those, thanks. I don't believe you will find IGrouping in there.
Robert Harvey
+1  A: 

I personally like the way of discovering hidden features on my own while solving a specific problem. In the end, a hidden feature that you never needed to get something done is of questionable value. It just adds clutter to the brain.

Matthias
I agree with you, but you can't use a feature if you don't know about it, and sometimes the solution that you settle on is sub-optimal because that feature remains undiscovered.
Robert Harvey
+12  A: 

Eric Lippert's blog. The real guts of C# - why there are some limitations which might seem arbitrary at first sight, how design decisions are made, etc.

Alternatively, for more variety, look at the Visual C# Developer Center - there's a whole range of blogs and articles there.

Oh, and read the C# spec. No, I mean it - some bits can be hard to wade through (I'm looking at you, generic type inference!) but there's some very interesting stuff in there.

Jon Skeet
Thanks Jon, I'll check it out.
Robert Harvey
+1 Eric's blog is well worth the time spent reading it.
Fredrik Mörk
+1 - Eric's blog and the Developer Center are both great places to go for people who want to dig deeper into the language.
Mark Brittingham
You forgot your own blog Jon but then again I guess you write more "blogs" on SO now and thank you for youe efforts :)
Rune FS
@Rune: Mark had already mentioned my blog. I didn't feel it was worth restating it :)
Jon Skeet
Thanks guys for the kind words. And I have been trying for many years to make the generic type inference section easier to read, but to little avail. It's hard enough making it _accurate_; there are lots of mistakes in this section of the spec, all of which are pretty much my fault. And its only going to get worse with variance; nikov has already found at least two mistakes in the variance spec, and variance makes method type inference considerably more complicated. Mads and I will do our best to come up with something accurate and readable.
Eric Lippert
+1  A: 

The way to do it is to use the MSDN library to look things up. Then take a little time to look around what you found.

That's especially important with the pure API documentation. For instance, I just browsed to http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx (note how that URL is formed). When I look in the Contents pane on the left, I see everything from XmlDocument (and XmlDocumentFragment) all the way down to XmlReader. In the middle are some things I rarely or never use, like XmlNamespaceScope and XmlNodeOrder.

From time to time, spend a little time on "abstract knowledge". Sometimes, it's good to look up from the trees to learn your way around the forest. You never know when you'll need something you've learned to get you out of the woods.

John Saunders
OK, I'll try that. I recently switched to the very cool new "low bandwidth" version of the MSDN library, and moving around in it has become much easier.
Robert Harvey
I agree, but I found I missed having a "sticky" language selection. So, I clicked the "feedback" link, and was taken to the forum for complaints. I read the first post there, and was told about "(lightweight)" mode. I like it even better. Try http://msdn.microsoft.com/en-us/library/c22k3d47(lightweight).aspx.
John Saunders
I like it! Going from 3 to 5 seconds per page refresh to 1 second without losing all of the features. Very cool.
Robert Harvey
A: 

For the people who don't know IGrouping:
http://msdn.microsoft.com/en-us/library/bb344977.aspx

I often read useful stuff on the Viual Studio Startup page and start clicking around to other keywords/areas. Not too promote StackOverflow too much, but you'll find some hidden gems here as well, simply by looking at how other people write code.

For example:
http://stackoverflow.com/questions/9033/hidden-features-of-c

Zyphrax
All of the Hidden Features posts can be found by doing a search on the stack overflow site for the tag, "hidden-features".
Robert Harvey
Except the "hidden features of hidden features" post. That one's hidden.
Jon Skeet