Managed Code
- Managed code is created by the .NET compiler.
- It does not depend on the architecture of the target machine because it is executed by the CLR (Common Language Runtime), and not by the operating system itself.
- CLR and managed code offer developers few benefits, like garbage collection, type checking, exceptions handling.
Unmanaged Code
- Unmanaged code is directly compiled to native machine code and depends on the architecture of the target machine.
- It is executed directly by the operating system.
- In the unmanaged code, the developer has to make sure he is dealing with memory usage and allocation (especially because of memory leaks), type safety and exceptions manually.
In .NET Visual Basic and C# compiler create managed code. To get an unmanaged code, the application has to be written in C or C++.

Leave a comment