A Wrong Solution

February 15th, 2007
[ Software Development ]

Drew passed me this link to Microsoft’s Partial Class Definitions:

“It is possible to split the definition of a class or a struct, or an interface over two or more source files. Each source file contains a section of the class definition, and all parts are combined when the application is compiled.”

Why would you ever want to do this? Well Microsoft says:

“When working on large projects, spreading a class over separate files allows multiple programmers to work on it simultaneously.”

Ummm….pardon? Let me translate that for you….

“We couldn’t really get source safe working well so instead we added this. So now you can have TranslateEngine_Dave.cs, TranslateEngine_Steve.cs, etc. Cool eh?”

Unless I’m missing something, this is a grossly wrong solution to a real problem. This is something I personally would not allow in a code base. When you have to start writing tools to parse your code base to ensure that certain language features like goto statements and this are NOT being used then you start to wonder about the overall direction of a language. Have the strength to say no, please.