What is Microsoft .Net?
The .Net platform also provides a set of technologies that enable a common environment for all applications written using a .Net language. The .Net Framework is designed with ease of use and code re-use in mind, and features many programming languages that can interact with each other.
In the .NET Framework, code is organized into hierarchical namespaces and classes and is divided into several key technologies: Common Language Specifications, consisting of the Base Class Library and Common Type Specification among other components, and the Common Language Runtime. In most cases the classes provided by the .Net framework can be extended through inheritance as the class hierarchy is not hidden from the developer. Only classes that have been marked as sealed cannot be extended.
Languages of .Net
Microsoft .Net has many languages that support the .Net framework. Microsoft's existing language, Visual Basic, has been upgraded to .Net and for the first time supports Classes and Object Orientation. Microsoft C++ has also been revamped to support the .Net framework.
Microsoft has introduced a new programming language called C# (C Sharp) which was designed specifically for the .Net platform. C# is derived from C++ and shares very similar syntax and constructs.
There are many other languages that support the .Net framework, such as Perl, Java, J# and Pascal (Delphi). This website deals specifically with the C# language.
The Following diagram shows how the .Net framework is structured and how each platform interacts with those around it.
Common Language Specification
The Common Language Specification (CLS) defines how the language interacts with objects and how objects interact with other objects. The CLS also provides a single set of data types for all languages, using a component called the Common Type Specification (CTS). If you have done any C++ programming you will be familiar with the C++ string being a character pointer (PChar or char*). In .Net a string is the same in all languages, so a Visual Basic application can call a method in a C# class library without the need for type conversion.
On the .Net platform, you don't have one rule describing how objects in C# behave and another rule describing how they should behave in Visual Basic. To steal a phrase, there is now "One rule to bind them all". Objects in Visual Basic and C# share the same methods and properties, same class behaviour and the same lifecycle.
In existing models, API's are used to interface with the Operating System or hardware. There was no consistency between different interfaces, parameter types had to be converted between languages and return types were often pointers to memory locations. With the introduction of the .Net framework everything is now part of a common system, and the nightmare of API programming is finally over.
Common Base Class Library
Taking the Common Type Specification one step further, the .Net platform provides a set of common classes. This also allows for code compatibility between languages. A button class in C# is the same as a button class in VB.Net or ASP.Net.
The Base Class Library also defines hundreds of classes, which you can use in your applications, so you spend less time working on the class development and more time on productivity and functionality.
Common Language Runtime
Traditionally a software application written for the Windows environment would need to be completely re-written, sometimes in a different programming language, in order for it to be able to run on a handheld device or other hardware platform. The .Net environment removes this re-coding and allows code to be used on any hardware platform supported by the framework. This technology, or component, of the .Net framework is called the Common Language Runtime (CLR). The CLR provides a managed environment for code execution, which performs certain maintenance functions and memory management. These are covered in more depth in the Common Language Runtime tutorial.
Summary and Conclusions
The Microsoft .Net platform provides developers with an environment that is platform and operating system independent (as long as it supports the .Net Framework). Developers spend more time developing the functionality of the program and less time re-writing code for different platforms.
The Common Language Specification allows other .Net language components, programs, class libraries etc... to seamlessly interact with each other.
The .Net Common Language Runtime provides a managed environment where memory is managed (Garbage Collection), it manages security, deployment and execution.
Last updated: 2017-06-23