Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Windows.Forms in System and not Microsoft?

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! :) )

like image 443
mcjabberz Avatar asked Jul 23 '09 21:07

mcjabberz


People also ask

Does Microsoft use WinForms?

Windows Forms (WinForms) is a free and open-source graphical (GUI) class library included as a part of Microsoft .

What is difference between WinForms and Windows Forms?

Winforms and Windows Forms are the same thing. Winforms is the shortened name for Windows Forms.

What is the difference between Windows Forms application and console application?

A Windows form application is an application that has a graphical user interface(GUI) like the Visual C# IDE. A console program on the other hand is a text application. There are not fancy controls like buttons or textboxes in a console application and they are run from the command prompt.

Is WinForms in .NET core?

NET Core 3.0 was released, Windows Forms went open source on GitHub. The code for Windows Forms for . NET 5 is a fork of the . NET Framework Windows Forms codebase.


2 Answers

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.

like image 132
adrianbanks Avatar answered Sep 23 '22 04:09

adrianbanks


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.

like image 37
Justin Niessner Avatar answered Sep 26 '22 04:09

Justin Niessner