Visual C# .NET Part 2: Compiling .NET Code - Managed Code vs. Unmanaged Code
(Page 2 of 5 )
When we write .NET code that uses the services, functions, and capabilities of the .NET Framework Class Library (FCL), then we call that code “Managed code” because it’s managed by the Common Language Runtime (CLR). As you know, the CLR manages the execution of .NET programs, and managing the code is one way of managing .NET applications. When we write Managed Code, we don’t care about memory management or handling operating system low-level functions because CLR abstract these details from us and manages them. So writing managed code will improve applications performance.
You can write “Unmanaged Code” too. It’s the code that is not managed by the CLR, but it’s your responsibility to manage the memory and many other things. CLR can’t control this kind of code, but at the same time this code is a powerful feature because you will gain access to the low-level operating system functions and maybe will be useful in some circumstances. But the most of us will use the managed code and benefit from CLR management and capabilities.
C# Overview
C# was created by Microsoft as the primary language for the .NET Framework. Microsoft designed C# in a way to make it easy for C, C++ and Java programmers to migrate to .NET. C# has roots in C, C++ and Java so this migration is easy for these languages’ programmers. C# syntax not complicated like C++ so learning C# is much easier that C++. Almost all of the operations that you can do with C++ you can do with C# except for the operations that access low-level operating system functions, but you still can do these operations using unmanaged code. C# is the best .NET language because it’s the only language that is designed specially for .NET Framework, and it will be the first language that will support .NET Framework versions on the other platforms.
.NET Framework Applications
With .NET Framework we can create any kind of applications that we want, but like the console applications which are simple command-line interfaces without any windows, Windows Applications which are applications with complex interface which contains buttons, menus, text boxes, option boxes and many other visual components. There are also web applications and web services, which are Internet-based applications and the core of Microsoft.NET technologies as we stated before. You will understand the different kinds of .NET applications as you go further in the .NET world. Here we will discuss the first two things (Console applications, Windows applications) only.
Next: .NET Framework and .NET Languages >>
More .NET Articles
More By Michael Youssef