Jump to content

Managed code

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 89.152.177.195 (talk) at 06:03, 8 November 2009. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Managed code is a differentiation created by Microsoft to identify computer program code that requires and will only execute under the "management" of a Common Language Runtime virtual machine (resulting in Bytecode).

This disambiguation is prevalent and only relevant when developing applications that interact with the .NET Framework or other Common Language Runtime implementations, like Mono. Since some of the classic programming languages have been ported into the Common Language Runtime, the differentiation is needed to identify "managed" code, especially in a mixed setup. In this same context programmers also refer to code that doesn't depend on the Common Language Runtime as unmanaged.

Microsoft's Visual C++ development environment can produce both managed code (running under the .NET Common Language Runtime) or compiled binaries, running directly on the Windows platform with the help of its C Runtime Library.[1].

Benefits of using managed code include programmer convenience (by increasing the level of abstraction, creating smaller models) and enhanced security guarantees, depending on the platform (including the VM implementation). There are many historical examples of code running on a virtual machines, such as UCSD Pascal utilizing p-code. Java popularized this approach with its bytecode executed by the Java Virtual Machine.

This is not to be confused to how compilers produce intermediate "pseudocode" with intention of compiling it further into target machine code, not running it within a virtual machine as managed code (see, for example, BCPL or ALGOL 68C).

Another source of confusion was created when Microsoft started connecting the .NET Framework with C++, it decided to call the result Managed C++, after some criticism on that name choice and further integration, C++/CLI took over.

References

  1. ^ Gregory, Kate (2003-04-28). "Managed, Unmanaged, Native: What Kind of Code Is This?". Retrieved 2009-04-22.