Coding Horror

programming and human factors

Return to the Planet of Managed Code Bloat

I just updated my post The Bloated World of Managed Code with baseline memory footprints for Console and Winforms apps in .NET 2.0.

I'll admit I am a bit of a hypocrite when it comes to managed code apps. Now that tiny, native BitTorrent clients are available such as uTorrent and BitComet, I just can't force myself to suffer through the Java (Azeureus) and Python (ABC) clients. They're nice enough, but I want small, clean and fast for this kind of app. And where's the .NET BitTorrent client, anyway?

Managed code can be plenty fast, but I've always said that managed code isn't appropriate for every kind of application. It's another tool in your toolbox, but not the only one.

One particularly egregious example of managed code misuse, however, is in ATI's Catalyst video card drivers. The "control center" is a client app which allows you to manipulate the settings. It's written in .NET 1.1 and launched via a button in the graphics driver tab.

ATI Catalyst launcher

It's a reasonable concept, but in practice-- it sucks. Even on a clean Pentium 4 3.2 machine with 1gb of RAM, loading the control center for the first time feels like almost a full minute of waiting for something to happen. As commenters on Junfeng Zhang's log point out, this is likely due more to poor coding than anything else. But what really irks me is that all I want to do is adjust a few minor video card settings. Is it really appropriate to have such a heavyweight app for such a simple task?

Which brings me back to using managed code in appropriate places. Although there was a bit of a hubbub about managed code and Vista last year, Microsoft is pursuing managed code aggressively, as Dan Fernandez notes in Debunking the Microsoft's not using Manged Code Myth. He provides a succinct list of recent Microsoft products and the number of lines of managed code in each one:

  • Visual Studio 2005: 7.5 million lines
  • SQL Server 2005: 3 million lines
  • BizTalk Server: 2 million lines
  • Visual Studio Team System: 1.7 million lines
  • Windows Presentation Foundation: 900K lines
  • Windows Sharepoint Services: 750K lines
  • Expression Interactive Designer: 250K lines
  • Sharepoint Portal Server: 200K lines
  • Content Management Server: 100K lines

Managed code is great. But a world where everything is managed code-- including the operating system and essential utilities-- is still pretty far off.

Written by Jeff Atwood

Indoor enthusiast. Co-founder of Stack Exchange and Discourse. Disclaimer: I have no idea what I'm talking about. Find me here: http://twitter.com/codinghorror