MS doesn’t have philosophy in designing their framework

I would like to show very simple example.

These GetHeight() methods are declared in Font ( .NET )

GetHeight() Returns the line spacing, in pixels, of this font.
GetHeight(Graphics) Returns the line spacing, in the current unit of a specified Graphics, of this font.
GetHeight(Single) Returns the height, in pixels, of this Font when drawn to a device with the specified vertical resolution.

Method names and variable names should speak for themselves except for very special case where they lack of any nomenclature.

However, look at that. They are all GetHeight. However, what they return are different.
The first two return line spacing, while the last one is the height of a chosen font.
Because it is “GetHeight” of Font class, it should be the height of a font. That is self-explanatory for the method. So, the first twos are named wrongly. They should be “GetLineSapce()”. Also, because Windows now supports DPI-independency, the “GetHeight(Single)” should return a value in DPI independent unit. Moreover they should provide functions to convert the DPI independent size to device specific size, and vice versa. (ADDED : There is a way to do that currently. However, .NET is higher-level framework than MFC. Current approach looks more for Win32/MFC than .NET )

This shows that they don’t think about “what framework should address”. You can say that they didn’t have enough time for handling DPI-independence, but then they should not say DPI-independency in Windows 7 yet, just like Apple does for its Mac OS X.
More fundamentally, again, the method names are wrong.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: