1

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?

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
  • Which is that book, just for curiosity ;-) – FerranB Jul 21 '09 at 22:42
  • To the voter to close: duplicated of which one? – FerranB Jul 21 '09 at 22:43
  • What book, you mean the one with IGrouping in it? I got that from this post: http://stackoverflow.com/questions/1160420/how-do-i-group-data-in-an-asp-net-mvc-view/1160455#1160455. Check out Mannish's comment in the answer. – Robert Harvey Jul 21 '09 at 22:44
  • He says it's a duplicate of http://stackoverflow.com/questions/9033/hidden-features-of-c. It's not. – Robert Harvey Jul 21 '09 at 22:46
  • 1
    This is not a duplicate. He's not asking what the features _are_, he's asking how to learn about features, so that, to him, they won't be hidden anymore. – John Saunders Jul 21 '09 at 22:58

6 Answers6

13

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
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • 2
    +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 Jul 22 '09 at 00:20
  • 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 Jul 22 '09 at 08:47
  • @Rune: Mark had already mentioned my blog. I didn't feel it was worth restating it :) – Jon Skeet Jul 22 '09 at 09:15
  • 2
    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 Jul 22 '09 at 16:35
6

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
  • 28,545
  • 12
  • 80
  • 110
3

How about the Hidden Features series of questions?

Hidden Features of C#

Hidden Features of ASP.NET

And many more...

Community
  • 1
  • 1
Matthew Jones
  • 25,644
  • 17
  • 102
  • 155
2

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.

Mats
  • 14,902
  • 33
  • 78
  • 110
1

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
  • 160,644
  • 26
  • 247
  • 397
  • 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 Jul 21 '09 at 22:17
  • 1
    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 Jul 21 '09 at 23:00
  • 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 Jul 22 '09 at 18:39
0

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:
Hidden Features of C#?

Community
  • 1
  • 1
Yvo
  • 18,681
  • 11
  • 71
  • 90