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 07:18, 10 November 2009 (first reference I've added and probably not the best, there should be others available...). 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++, and the selection on how to name the Managed Extensions for C++, it was first named Managed C++ and then renamed to C++/CLI. Bjarne Stroustrup, creator of the C++ programming language and member of the C++ standards committee even commented on this issue, "On the difficult and controversial question of what the CLI binding/extensions to C++ is to be called, I prefer C++/CLI as a shorthand for "The CLI extensions to ISO C++". Keeping C++ as part of the name reminds people what is the base language and will help keep C++ a proper subset of C++ with the C++/CLI extensions." [2].

References

  1. ^ Gregory, Kate (2003-04-28). "Managed, Unmanaged, Native: What Kind of Code Is This?". Retrieved 2009-04-22.
  2. ^ Stroustrup, Bjarne (2009-06-29). "Bjarne Stroustrup's FAQ: What do you think of C++/CLI?". Retrieved 2009-06-29.