views:

154

answers:

3

I always had the idea that the root namespace in .NET, "System", was mainly for stuff that didn't depend too much on a particular platform.

I was wondering if anyone had any ideas or insight as to why the Windows.Forms namespace is in System and not Microsoft since it seems to be fairly entrenched in one platform.

(No flame wars or unnecessary MS bashing if at all possible please! :) )

+10  A: 

I read somewhere that the System.* namespaces are for things that are part of the core .Net framework, whilst the Microsoft.* namespaces are for additional "value-added" optional extras, or things that are in development.

EDIT:

Brad Abrams has a discussion about it in his blog post What Does that .NET Namespace Mean: System.* and Microsoft.*

Additionally, a quote from Visual Basic 2005 with .NET 3.0 Programmer's Reference:

The Microsoft root namespace contains Microsoft-specific items. In theory, any vendor can implement .Net languages that translate into Intermediate Language (IL) code. If you were to build such a language, the items in the Microsoft namespace would generally not apply to your language. Items in the System namespace ... would be as useful to users of your language as they are to programmers who use the Microsoft languages, but the items in the Microsoft namespace would probably not be as helpful.

This would imply that if I was to make a new .Net language, I would be able to make use of the System.Windows.Forms namespace to make UIs, but I would probably not have much use for classes in Microsoft.* namespaces.

adrianbanks
Very good point! Never thought of it that way, but it indeeds makes a lot of sense.
mcjabberz
+1  A: 

My guess would be:

Microsoft envisioned the .NET framework as having the ability to be multi-platform, but they were only going to provide a runtime environment for the Windows platform. They probably assumed that anybody providing a runtime environment for another platform would implement it in such a way that System.Forms could be used. The runtime would handle the differences between the native implemenations.

Justin Niessner
Not particularly believable, considering how tied System.Forms is to User32.
EFraim
Very true. I keep hoping that maybe the namespace was conceived before the implementation...and the implementation wasn't what they envisioned. Doubtful, I know.
Justin Niessner
A: 

Just because "Microsoft Windows" has been abreviated to "Windows" in doesn't mean that the "window" concept isn't wider than Microsoft. All implementations of GUIs since the original IBM PARC interface through Microsoft Windows, X11 etc all refer to Windows and Form controls, it is just that Microsoft have called their particular implmentation "Windows". Thus System.Windows.Forms seems correct as it is not necessary for a window to be part of "Windows". Probably to it should be just windows with a lower case w. But that would break the nameing conventions of the namespaces.

David McEwing
Actually Windows.Forms is specialized for the Microsoft(R) Windows look and feel, as opposed to GTK# and Cocoa#
Residuum
Actually I think the reason you get the Microsoft(R) Windows look and feel is because you are using Microsoft(R) Windows. See the answer by @adrianbanks.
David McEwing
When I compile Windows.Forms with mono in Debian Sid, I still get Microsoft Windows look and feel, similar to running Microsoft Windows applications with wine.
Residuum