The Most Useful .NET Utility Classes Developers Tend To Reinvent Rather Than Reuse

Wow, what a post title. It's a couple of weeks old, but this list over at haacked.com is a quick list of classes that developers tend to code themselves rather than use what's provided in the framework. The constant reinvention is symptomatic of a large and comprehensive framework - there's so much in there, it's sometimes hard to know where to look for something that does what you're trying to do.

Looking through the list was quite refreshing. There were a few obvious ones such as System.IO.Path.Combine, however I'd never thought that a framework which is destined to run on mostly Windows boxes (and yes I know about Mono, but it was hardly Microsoft's core concern when writing the framework) would have something like Path.DirectorySeparatorChar, which returns the correct directory seperator for your current environment (of course it could just return "\" regardless..). Something I'd not seen before was VirtualPathUtility, which contains neat functions such as ToAbsolutePath, AppendTrailingSlash, Combine, and MakeRelative.

There's loads more mentioned in the comments as people chime in with their 2 cents worth. Worth a read.

Tags: ,

Posted on Monday, June 25, 2007 10:03 PM | ASP.NET Web Development C#

Like this? Share it!

No comments posted yet.

Post a comment
Please add 7 and 6 and type the answer here:
Remember me?
Ensure the word in this box says 'orange':