InfoQ

News

Do Language Specific Libraries Belong in .NET?

Posted by Jonathan Allen on Jun 03, 2008 06:32 AM

Community
.NET
Topics
Language Design,
.NET Framework
Tags
IronPython,
J#,
Visual Basic.NET,
C#,
IronRuby

Though people have been asking for it for years, developers still need write recursive directory copying routines themselves, and every one is nearly identical. So why doesn't this simple and useful function exist in the .NET framework? Actually it does, if you reference the Microsoft.VisualBasic assembly.

Reading and writing to ZIP files is another common task for programmers. A bit more complex than copying directories, developers often turn to third-party libraries or command line tools. Needlessly in fact because ZIP libraries have been in the .NET Framework since the beginning. You just have to dig them out of the J# runtime (and hope the libraries are not decommissioned).

Moving on to our third example, developers often have to read flat files in comma-separated (CSV) and fixed-width formats. While seemingly straightforward, minor points like escaping quoted strings are easily overlooked. Slipped into .NET 2.0 is VB's TextFieldParser, a general-purpose flat file parser suitable these and other similar file types.

So should these little gems remain "language specific", or should they be migrated to the core namespaces of the .NET Framework? A minor question now, but one that is sure to become more pressing as the new languages F#, IronRuby, and IronPython come online.

4 comments

Reply

Add Them To The Core! by John DeHope Posted Jun 3, 2008 7:53 AM
Re: Add Them To The Core! by Neil Robbins Posted Jun 3, 2008 5:05 PM
YES by Jim Leonardo Posted Jun 4, 2008 12:34 PM
Re: YES by Francois Ward Posted Jun 4, 2008 3:29 PM
  1. Back to top

    Add Them To The Core!

    Jun 3, 2008 7:53 AM by John DeHope

    This is a great question! I would argue that clearly these kinds of cross cutting concerns belong in the core. There is nothing language specific about any of these at all. Can we add the My library to this list? I've never been able to use it, since it's a VB.Net technology, and I am a C# guy. But it has always seemed really useful to me.

  2. Back to top

    Re: Add Them To The Core!

    Jun 3, 2008 5:05 PM by Neil Robbins

    It would be better in the code but - Just reference the .dll from your C# project and then use as usual. For more info see my blog http://neildoesdotnet.blogspot.com. Reflect on the Me library and most of it is found elsewhere in the framework but is brought together for convenience. For those bits that aren't the code is pretty simple recreate using Reflector.

  3. Back to top

    YES

    Jun 4, 2008 12:34 PM by Jim Leonardo

    It's simply silly that these aren't in the core runtime, especially the zip libraries. I personally see no real reason for ANY functionality that is not totally language specific to be found in a language dll.

  4. Back to top

    Re: YES

    Jun 4, 2008 3:29 PM by Francois Ward

    Some are really language agnostic and should always be there: for example the zip libraries. I know that to some extent, the restriction on the zip stuff is -partly- because of super complex licensing agreements with patented stuff in the background, so it may not be that simple, but still, the default compression API should be much better than it is now (stream only? ugh!)

    For other stuff, its a matter of best practice and backward compatibility. Certain features, especially in VB.NET and J#, are only there for backward compatibility, and do not represent the official best practice for certain tasks in other languages, or have a philosophy that is language specific in design (The My deal and half of what is in the VisualBasic assembly, Eval in JScript.Net, etc). Those shouldn't be there.

    If the functionality is that useful however, it should be part of the core, in a flexible enough way that follows the .NET framework guideline and best practices, while being careful not to bloat the framework more than it already is, and the language specific stuff can simply be wrappers around it to give each language their distinctive feel (again: the My stuff in VB.NET does exactly that).

    Otherwise, languages that are supported, but have to be compatible with something else through their API, not just the language semantics (IronRuby, F#, etc) would bloat the framework with every new one, features would start getting duplicated, etc.

Exclusive Content

SOA Governance: An Enterprise View

Michael Poulin explains the necessity for SOA governance to ensure an Enterprise SOA's success, relying on concepts from the OASIS SOA Reference Model and Reference Architecture.

Developing Portlets using JSF, Ajax, and Seam (Part 2 of 3)

This article covers setting up a RichFaces portlet using JBoss Portlet Container and JBoss Portlet Bridge, deploying a RichFaces portlet, and RichFaces capabilities.

Scalability Worst Practices

This article discusses scalability worst pratices including The Golden Hammer, Resource Abuse, Big Ball of Mud, Dependency Management, Timeouts, Hero Pattern, Not Automating, and Monitoring.

Do the Hustle

Obie Fernandez shares his experience selling consulting services for both Thoughtworks and Hashrocket and give tips how Ruby developers can work with clients.

Natural Laws of Software Development - Deriving Agile Practices

Jeffries and Hendrickson derive Agile practices from the natural laws of software development. They don't just say "Be Agile!", but they explain why Agile practices make perfect sense.

Jinesh Varia About Amazon Alexa Web Service's Architecture

Jinesh Varia talks about the architecture of one of Amazon's web services called Alexa. Jinesh explains how Amazon has reached scalability, performance and reduced costs for the Alexa service.

"We Suck Less!" Is Not Enough

David Douglas and Robin Dymond discuss about companies adopting Agile, but don't go all the way, resulting in failure and rejection of it, and predictably having a negative impact on Agile's future.

The Development of a New Car at Toyota

Kenji Hiranabe talks about Toyota's development process of a new car. Kenji shares his experience meeting Nobuaki Katayama, former Chief Engineer at Toyota, and the lessons he learned from him.