Derik Whittaker



Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at
Great code comments I stumbled across.

Today I was looking at some .Net 3.5 source code and ran into these great comments. 

      //ok, this is a hairy, dirty, and nasty piece of code
      //the alternatives are substantially worse than this though
      //i.e. when you do your own provider, LINQ assumes that
      //you are going to implement your own expression tree visitor and
      //do it all yourself.  Frankly, I still have xmas shopping to do
      //and I really don't want us to be foobared when we get
      //even more extension methods added to LINQ
      //therefore, we are pulling execute based on taking the calling the standard execute on
      //enumerable, but using our own class

This is great because it is truthful and explains the exact intent or thought process of the developer.

//pray.  If something is going to break, it will do so here
return genericMethodInfo.Invoke(null, paramList.ToArray());

We have all put comments in here

I know this post was kinda pointless, but thought it would cause some to smile

Till next time,

Posted 04-05-2008 3:39 PM by Derik Whittaker
Filed under: ,



Daniel Patterson wrote re: Great code comments I stumbled across.
on 04-06-2008 6:14 PM

"I still have xmas shopping to do" - priceless.  

Derik Whittaker wrote re: Great code comments I stumbled across.
on 04-06-2008 6:20 PM


Yes, that is a great comment.  And because I know the author of that, it is even better :)

PartialClass wrote re: Great code comments I stumbled across.
on 04-15-2008 6:05 AM


I always like such programmatic fun

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Google Reader or Homepage Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of
Red-Gate Tools For SQL and .NET


SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
NHibernate Profiler
Balsamiq Mockups
JetBrains - ReSharper
Web Sequence Diagrams
Ducksboard<-- NEW Friend!


Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers


Community Server (Commercial Edition)