What Is Managed Code?


Managed code will be mentioned quite often during the course of this book. The API that will be used throughout the book is called Managed DirectX, and it's not uncommon at all to hear the .NET languages called the managed languages. The managed term comes from the fact that the .NET Runtime has a built-in memory manager.

In the "old days" (you remember, just a few years ago), developers who were writing code in C and C++ would have to do their own memory management. Allocated memory would have to be freed when it was no longer necessary, unless you wanted that memory to "leak," which could be the cause of horrible performance later on down the line. Even worse, because you were dealing directly with pointers, it's quite easy to corrupt the memory your project is using. In many cases, this leads to long debugging sessions because in the majority of cases where you actually see the error occurring is nowhere near where the memory originally became corrupt.

The C and C++ languages have a reputation of being "hard" mainly because of many of these types of issues. Many developers were reluctant to try out C or C++ because of this reputation, and thus tried out some other high-level languages that could eliminate these headaches, such as Visual Basic. Although these new languages did have the benefits of being easy to use and learn, they also had drawbacks. The performance of these other languages wasn't competitive with C and C++, at most times noticeably slow. Also, because the underlying operating system was developed using C++, not all of the features were available in these other languages. Although you could do quite a bit of good work using them, if you wanted all the power, performance, and features available with the operating system, you were on your own, if it was possible at all.

With the release of the first version of the .NET Runtime, much of this changed. Microsoft went back to the drawing board, designed an entirely new API, and tried to make sure developers' concerns were addressed. This new Runtime had to be easy to use, it had to be fast, and it had to eliminate the headaches of memory management. Throughout this book, you will see how well they actually achieved these goals.



Beginning 3D Game Programming
Beginning 3D Game Programming
ISBN: 0672326612
EAN: 2147483647
Year: 2003
Pages: 191
Authors: Tom Miller

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net