November 18, 2009

Benefits of .NET Framework

  • The .Net Framework, provides the necessary compile-time and run-time platform to build and run .Net based applications.
  • The .Net platform is designed with ease of use and code re-use in mind, and features many programming languages that can interact with each other.
  • Common Language Specification means that data types in all .Net applications are the same, so no type conversion is required when calling C# or C++ .Net methods from Visual Basic, or vice-versa.
  • Base Class Library provides hundreds of predefined classes that can be used.
  • Code developed for the .Net framework is portable between desktop, server and handheld architecture.
  • Memory leaks are significantly reduced as the .Net Common Language Runtime provides a managed environment where memory is maintained by the Garbage Collector. The CLR also manages security, deployment and execution.
  • Improved security between remote services
  • Inbuilt XML readers/writers/parsers and also has the ability to serialise structures to XML format.
  • C# is a language specifically designed for the .Net platform, unlike Visual Basic and C++ which have been adapted to accommodate the framework.

 

The framework does have its disadvantages however. Because all code is "compiled" into MSIL code, regardless of the language it was coded in, the MSIL code needs to be further compiled into the native code for the platform it is running on. When an application is compiled to MSIL code it is more accurate to say that it is being translated because MSIL is a programming language similar to assembler. This MSIL code can be dissembled by tools such as ildasm and .Net Reflector to reveal the original source code (minus a few non-important items such as white space, comments and so on).

 

As long as you don't mind source code being distributed .Net is fine. ASP.Net and web services are not affected by this since the executable is not directly accessible, however if you create a web application to distribute or sell, the code can be seen by anyone with access to the executable and a decompiler. There are tools available to help combat this and we will discuss the decompilation issue in a later tutorial when we look at security.

No comments: