KBD

Keith Devens .com

Friday, July 4, 2008 Flag waving
"To know what *would* have happened, child?" said Aslan. "No. Nobody is ever told that." – C.S. Lewis (Aslan, in Prince Caspian, Chapter 10)
← Unescape form-encoded textThe WS tower of Babel →

Daily link icon Friday, March 24, 2006

.NET standard library has holes

The .NET standard library is good, but it feels like it has lots of "holes" in it, even in 2.0. For instance, why is the Converter delegate used separately on Array's and List's ConvertAll rather than being defined on a Collection or an Enumerable so that I could use ConvertAll on things like Dictionary.KeyCollection? The answer, of course, is that Collection and Enumerable are actually ICollection and IEnumerable and are not classes.

So, Microsoft didn't choose to duplicate ConvertAll everywhere it'd be useful, just in a couple of places. What this means as well is that even though you can use a foreach loop on something, you can't necessarily do a ConvertAll on it (or use the other higher-order methods). In contrast, look at Ruby, where as long as you have an each method (IIRC), you get everything associated with it for free.

Also see Adam's description of GetValue and SetValue on properties and accessors, another case where Microsoft has the same method names for similar functionality on multiple classes but no common interface or base class between them, so they can't be used interchangeably. (Insert comment about the utility of duck-typing here...)

As an aside, I also feel like it's just darn hard to find things reliably in Microsoft's documentation.

← Unescape form-encoded textThe WS tower of Babel →

Comments XML gif

Adam Vandenberg (http://adamv.com/) wrote:

Microsoft's documentation sucks, as a first-degree approximation.

Granted that things look different in Windows XP vs. Windows 2000, etc., but the WinForms documentation doesn't even give baseline looks of the different controls. Sure "we all know what a progress bar looks like", but what does it look like when set to Style=Marquee?

Microsoft puts in a lot of effort to get every method, event, and property documented on their .NET classes. Which is like explaining how each phoneme sounds, but then not telling you how to put words into sentances.

The docs for common string formatting codes is unbelievably bad and spread out compared to, say, almost any other C++ printf cheat-sheet I've ever seen.

And so forth!

∴ Adam Vandenberg | 27-Mar-2006 2:32pm est | http://adamv.com/ | #9356

Keith Gaughan (http://talideon.com/) wrote:

Amen on the docs, but I'd add that the documentation sucks from a navigation standpoint too. Some of Java's documentation might suck, but at least the navigation makes some kind of sense.

However, the FCL and sundry have more fundamental flaws. By way of demonstration, try calling .ToString() on just about anything. Rather than getting a reasonable stringified version of the object, you just get the cryptic default junk generated by Object's implementation. For instance, does an instance of XmlElement return the XML fragment it represents? Nope.

That's just plain idiotic.

∴ Keith Gaughan | 28-Mar-2006 5:43pm est | http://talideon.com/ | #9357

Keith (http://keithdevens.com/) wrote:

Yes! I've been annoyed that most of .NET's classes don't stringify into anything useful.

Keith | 28-Mar-2006 9:02pm est | http://keithdevens.com/ | #9358

Adam Vandenberg (http://adamv.com/) wrote:

This could be handy:
Format String 101:
http://blogs.msdn.com/kathykam/archive/2006/03/29/564426.aspx

∴ Adam Vandenberg | 3-Apr-2006 2:32pm est | http://adamv.com/ | #9375

Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

July 2008
SunMonTueWedThuFriSat
 12345
6789101112
13141516171819
20212223242526
2728293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 5 posts

Recent comments XML

Girls, please don't get breast implants

> And no, you will not be receiving​a picture.

:-(...

Keith: Jul 2, 6:05am

Javascript clone function

This is a clever way to clone an​object if you are using YAHOO UI.​Same tec...

Antonio: Jul 1, 12:47pm

I hate Norton Antivirus

Oh just one other thing norton is​great at keeping people out of your​compu...

kevin.sands: Jul 1, 12:50am

Terminator 3 was awful

I think the biggest reason why T3​totally blew was because Edward​Furlong g...

76.167.172.64: Jun 29, 3:06am

Generated in about 0.212s.

(Used 8 db queries)

mobile phone