Web 2.0 .NET vs. LAMP Part 3: Managed Code

Part IIIOur Story So Far:

In Part 1 of this series, I pointed out that .NET and LAMP development is a matter of preference not features, or performance, or scalability. Basically .NET = LAMP for Web 2.0.

In Part 2, I talked about how the lack of professional project management for open source frameworks can lead to constantly churning architectures and abandoned projects.

By now, you might think I’m a Microsoft otaku. Maybe. Or, maybe I’ve learned through 15+ years of trying to transform ideas into production quality code that the popular answers are not always the best answers. It is popular to say that LAMP is more scalable than .NET or that open source code is better because it is free. You don’t make many friends at in the high tech world by calling into question the ubiquitous popularity of LAMP.

But now for the dramatic conclusion of the Web 2.0 .NET vs. LAMP showdown: Managed Code, what it is and why you should care.

Did you ever wonder why your computer crashes? What causes the dreaded blue screen of death or the spinning beach ball of death? Unmanaged code. Managed code, a term coined by Microsoft but a concept found in plenty of LAMP environments, is code that has boundaries. Managed Code runs inside a VM, a virtual machine, and it must obey the edicts of the VM. If the VM says it can’t write to a particular location in memory then that location is off limits. If the VM says it has to stop execution so the VM can check the health of the system then that is exactly what the code does. In the world of Managed Code the VM is the traffic cop, the code is the motorist, and the computer is one big speed trap.

The reason your computer crashes is that it runs mostly unmanaged code. Windows, Mac, Linux, it makes no difference. The majority of the code that you use to browse the web, process words, or play music is unmanaged. Every once in a while a program tries to access a location in memory that is off-limits or has been modified by another program (or like an Alzheimer victim the program forgets and modifies it’s own portion of memory accidentally). A bad value in a single location can cause one or all your applications or even your operating system to die an ignoble and meaningless death like Captain America.

The solution to this problem and the other issues that make your computer act weird or require a reboot is Managed Code. As I said, you don’t need .NET to get Managed Code–it’s not even a Microsoft invention. Java and Flash (or is it called Adobe Air these days?) are both Managed Code. But Microsoft has been on the forefront of evangelizing Managed Code. They are even working on a new OS, Singularity, that is all Managed Code.

I just don’t see the same kind of commitment to the idea of Managed Code in the LAMP community that I see in the Microsoft community. Managed Code won’t solve all of our problems, programmers will still make design and implementation mistakes, but it will help us find those mistakes more quickly and keep different programs from messing each other up.

So who wins? .NET or LAMP? Which technology stack makes the best Web 2.0 applications? Both will work. What matters is that you have a choice. If someone tries to sell you on solving all your development problems by migrating from .NET to LAMP or vice versa don’t buy it! Instead use the technology stack that your technology team deeply understands. If your developers were weened on open source than stick with it. If your tech guru is Microsoft certified then that’s where your web apps belong.

More links: Amanda McPherson, Michael Dolan, Mary Jo Foley, Paul Murphy

Read the series:

-- John Pavley



Sphere It



Tags: , , , ,

2 Responses to “Web 2.0 .NET vs. LAMP Part 3: Managed Code”

  1. Phil Says:

    If we are discussing managed code in the sense that it is run on a VM (which is basically an interpreter) then PHP was “managed” possibly before .Net was released (need to double check dates). The fact that there doesn’t appear to be a commitment to this from the LAMP community may be because it was built this way from the beginning and its not being tossed around as a new marketing buzzword.

    I don’t believe there is any advantage gained by .NET’s managed code over the Zend Engine interpreter.

  2. John Pavley Says:

    Phil, Yes you are correct, PHP, and plenty of LAMP dev environments, run inside VMs. I don’t know if the Zend engine is superior to Microsoft’s CLR. What I do know is that Microsoft makes a big fuss about their support for VMs where as the LAMP community as a whole seems fussy about other things. There is still plenty of mission critical software written in dangerous ways. I would just like someone beside Microsoft to be sounding the alarm.

Leave a Reply

 

Additional Related Posts: Categories to explore: