BYTE.com
RSS feed

Newsletter
Free E-mail Newsletter from BYTE.com
Email Address
First Name
Last Name




 
    
             
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
Dr. Dobb's Media Center
BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE: Volume 2 - Heuristic Algorithms
The Best of BYTE: Volume 2 - Heuristic Algorithms
In this volume of Best of BYTE, we explore the emergence of some heuristic algorithms. Although we have only scratched the surface of this intriguing subject, we hope we've suggested the potential of the synthesis of heuristics and algorithms.

© 2008 Think Services, Privacy Policy, Terms of Service, United Business Media Limited
Site comments: webmaster@byte.com
Web Sites: BYTE.com, dotnetjunkies.com, Dr. Dobb's Journal, SD Expo, Sys Admin, sqljunkies.com, Unixreview



MarketPlace
Easily add update features to your applications. A complete .Net updating solution.
Automatically capture customer crash data, no debugger required. Support for .NET, C++, OS X, Java.
Develop 10 times faster ! ALM, IDE, .Net, RAD, 5GL, Database, 5GL, 64-bit, etc. Free Express version
Understand C/C++ code in less time. A new team member ? Inherited legacy code ? Get up to speed faster with Crystal Flow for C/C++. Code-formatting improves readability. Flowcharts are integrated with code browser. Export flowcharts to Visio.
Develop distributed systems conforming to open standards like CORBA and Web Services faster with SANKHYA Varadhi - The Digital Bridge.
Wanna see your ad here?
 

web2