Scott Hanselman

The Weekly Source Code 4

September 5, '07 Comments [6] Posted in Source Code
Sponsored By

In my new ongoing quest to read source code to be a better developer, I now present the fourth in an infinite number of a weekly series called "The Weekly Source Code." Here's some source I'm reading this week that I enjoyed.

  • PoshConsole - This is a PowerShell console replacement written in WPF (.NET 3.0) with C#. Best feature? PowerShell "QuakeMode", totally. This source was fun to read.
  • Koolwired.IMAP - The beginnings of an IMAP implementation. Not sure why I like reading Mail Protocol implementations, but I also love...
  • Lesnikowski Mail.dll - This is the POP mail library that DasBlog uses, although he's updated it considerably and now charges a bit. The OLD OLD source is in DasBlog still and worth reading.
  • C#.NET del.icio.us API - I use the http://del.icio.us social bookmarking service and this is a C# API for that service. Simple, but fairly clean. I don't usually take the time to abstract thing this much, I'm a bit (a lot) more sloppy, and I'm always impressed when folks take the time.
  • WPF Contrib -The start of a WPF Controls project...this first release includes lots of Helpers and Utilities, as well as some panels that you wish you had in WPF.
  • Wintellect Power Collections - An oldie but a real goodie, the Power Collections formerly hosted on Wintellect have moved over to CodePlex for future development. Some of the collections included are the Deque, MultiDictionary, Bag, OrderedBag, OrderedDictionary, Set, OrderedSet, and OrderedMultiDictionary. It'll be interesting if the community takes up the codebase and moves it forward. This code is a gold mine. It's well organized, clean, well-documented and has a fine set of Unit Tests. I should write code this clean.
  • NLinq - I don't have to agree with the concept to think the source is cool. Inspired by this blog post, these guys are kind of reimplementing LINQ for .NET 1.1 and 2.0 by putting the LINQ expressions in a string, like this. Very clever as they are tunneling LINQ expressions through their stuff as a 3rd class API. But what price their immortal souls? ;)
  •  query = new NLinqQuery(
                    @"  from m in methods
                        where !m.IsStatic
                        orderby m.Name
                        group m by m.Name into g
                        select new { MethodName = g.Key, Overloads = g.Count() }");

Feel free to send me links to cool source that you find hasn't been given a good read.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web
Thursday, September 06, 2007 4:03:52 AM UTC
Does anyone read the licenses for these "open-source" projects?

Here's one for the Wintellect Power Collections:

"That the Software is subject to U.S. export jurisdiction at the time it is licensed to you, and it may be subject to additional export or import laws in other places. You agree to comply with all such laws and regulations that may apply to the Software after delivery of the software to you."


What does that even mean? Why does an open-source project whose source-code is available online for everyone in the world to view, even have something like that?

:-)
Sushant Bhatia
Thursday, September 06, 2007 6:02:29 AM UTC
Do you really read all that source code in one week? Or are you just expecting your blog readers to do so?

Maybe you could write a few words about how you are reading the source code. If I start to read source code I end up being so immersed that I spend a couple of hours ateast for each project. Often project also require some old component I must hunt down and download before compile and that might take an extra hour.

Maybe you could write a book about the subject "Reading bed-time source code with Scott" and audio book might be interesting to "Scott reads you source code aloud".

I am really just curious.
Øyvind
Thursday, September 06, 2007 9:03:12 AM UTC
I spend about 20-30 minutes per project reading and trying to understand. I also mentally note certain algorithms and techniques for reference so I'll know where to come looking for them later on. I also bookmark (in my head) the existance of these projects so if I'm ever on a project that has some similarity I'll be able to come back and refresh my understanding of what the source did and use it's techniques in my new project.
Thursday, September 06, 2007 1:14:08 PM UTC
You must have a steel trap memory. I can't remember what I read last night. What was this post about? :)
Kevin Goff
Friday, September 07, 2007 10:24:10 AM UTC
Hi Scott,

Thanks for mentioning Mail.dll component on your blog. It is a real pleasure to see the link here.

The one thing I just want to say is that the code in dasBlog source control is really, really old, and frankly I'm a bit ashamed of it now (and that's good because it means that I've learned few things since then).

Mail.dll was rewritten entirely, to use more of Separation of Concerns, Inversion of Control techniques. It now has unit tests, and much cleaner programming interface.

Do you think that people would like the PowerShell version of it?

Anyway, thanks for mentioning it on your blog.
Monday, September 10, 2007 1:13:24 PM UTC
RE: getting Linq functionality on .net 2.0 -- i think someone demonstrated a few days ago that this is possible today if you use VS 2008 to build, targeted at 2.0, and include the relevant dlls directly in your project (since they won't be in the gac/framework of your target machine) -- ahhh, i've found a link (pun intended) on this:

http://weblogs.asp.net/fmarguerie/archive/2007/09/05/linq-support-on-net-2-0.aspx

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.