BYTE.com > Mr. Computer Language Person > 2003
Managed Code Is Not a Panacea
By Martin Heller
November 3, 2003
(Managed Code Is Not a Panacea
: Page 1 of 1 )
I often hear about people doubling or tripling their software-development productivity upon adopting managed code—specifically, when they do a new project using Microsoft's .NET Framework rather than Visual Basic 6, Visual C++ 6, or almost anyone's Java development environment. (I'll exclude M7 from that, though.)
Part of the reason for managed code's big productivity boost seems to be the increased functionality built into the .NET Framework and the Framework Class Libraries; part of it is the assistance programmers get from the visual design and assisted coding tools built into Visual Studio .NET. People also cite improved code reuse from the object-oriented features of C# and Visual Basic .NET, if they've come from a Visual Basic 6 environment, and they love the garbage-collected memory management of the .NET Framework if they've come from unmanaged C++.
Another big factor in the productivity boost is the shortened debugging phase. Garbage collection pretty much eliminates memory leaks caused by forgetting to free what you allocated, and managed memory pretty much eliminates the class of errors that comes from writing through un-initialized pointers. Hard crashes from bad code are not going to happen if you stick to verifiable managed code.
On the other hand, managed code doesn't force you to get your logic right, or eliminate thread race conditions. Furthermore, non-deterministic finalization and garbage collection open up a whole new class of potential memory leaks. Let me explain.
Managed Memory Still Has Issues
The general way that the .NET Framework's memory manager works is this: When the program wants to store a value or object on the heap, it gives it to the Framework, which finds room for it, and returns a reference to the location on the heap where the value was stored. Periodically, the runtime sweeps through the heap (I'm simplifying here: it's highly optimized) and releases objects that no longer have any active references—garbage collection, in other words.
Page 1 of 1
BYTE.com > Mr. Computer Language Person > 2003
|