Dear Microsoft: How Many String Types Is Too Many?
Friday, January 04, 2008   

.NET needs more string types. Just having the one is too straightforward.

Over in the native C++ Windows development world, string classes are a dime a dozen. If one developer so much as looks at another developer, bam: new string class. Somebody sneezes: new string class. Just take a look at the arsenal of string weaponry offered by the native C++/MFC environment:

char
wchar_t
TCHAR
OLECHAR 
char*
wchar_t*
const char*
const wchar_t* 
std::string
std::wstring
std::stringstream
std::wstringstream
CString
CStringT
LPSTR
LPCSTR
LPWSTR
LPCWSTR
LPTSTR
LPCTSTR
OLESTR
BSTR
_bstr_t
CComBSTR

 

That's enough string firepower to equip a small army. How many man-hours did it take to develop this alien string technology? How many man-hours invested by the Windows developers of the world to learn it, code it, and debug it? Thousands of man-years, that's how many. All so I can spell Jean-Claude's name with the accent grave (or whatever).

As for the question of how many string types is too many: 37. Any more than that, and you start to get some overlap in terms of functionality. Any less than that, and the code starts to make too much sense, and that, as I've said before, is no way to ensure job security.

Advertisment