Have you ever gotten to the end of a project, and thought to yourself, “If I only knew then what I know now, I’d have done this part differently. And this. And that…”
Well, once upon a time, object-oriented programming had firmly come into its own, at least in terms of how a program was written for itself. People were starting to get an inkling that there had to be more object-oriented ways for individual computer programs to talk to each other and share components. At the time, if two programs wanted to share data, the data had to be serialized (written to a text file, spit out through a COM port, etc) in an agreed-upon format, and both programs had to contain the code that gave those formats meaning. Surely, there had to be a way to reuse the components in other programs from within your own program?
The first step (in a Microsoft-centric world), was the DLL - the dynamic link library. You could actually call some other program’s code from within your program - provided you could learn to speak their language. Speaking their language was actually quite a trick, as even different compilers of the same languages didn’t agree on what exactly the basic data types were. One thought a string was a contiguos section of memory with a null character to mark the end. Another thought it should be an integer, followed by a character array with a number of elements equal to that integer. And the next compiler thought something else entirely. The process of massaging your data to meet the format of the data required by the DLL you were calling (marshalling) was a gigantic PITA, and required some pretty in-depth knowledge of the language that the other guy wrote his components in. It also wasn’t very object-oriented; you were calling methods, not accessing other components’ object models.
Time went on, and the process improved. In Windows 3.1, we got a little more object-oriented with OLE. OLE begat ActiveX. We started registering component interfaces in the registry, and ActiveX begat COM, bringing with it the scourge of DLL-Hell, when your program went all to shit when a registered interface didn’t actually match the current DLL version. COM beget DCOM. DCOM led to, in the VB/VC++ 6.0 era, COM+. COM+ is very nice. If you’ve ever written a VB6 app that integrated with, say, Microsoft Excel, you probably had a very easy time instantiating and manipulating Excel objects. But that’s because COM+ is a whole lot of code that is hiding some very, very ugly stuff. Under that hood, it is still based on that old technology from the very first days Windows-based programs first started learning how to talk to each other.
And then Microsoft said, “If we knew then what we knew now…” , and “if computers had as much memory then as they do now…”, and “if processors were as fast then as they are now…” But the difference between Microsoft and Joe Programmer working on his little project is…bajillions of dollars. Microsoft actually took millions of dollars, rounded up a great collection of computer science’s best brains, and wrote a whole new component architecture from scratch, learning from the lessons of COM’s past, keeping and improving upon the best of the best, and throwing out or reworking what sucked. The result is the .NET Framework.
“So what?” you say, “I’m not doing integration work between a bunch of applications - I’m just writing simple, self-contained business apps.” Oh, but you are. Every window you bring up, every button and text box you put in that window, you are most certainly not writing from scratch - you’re accessing Windows services to create those elements for you. And it isn’t just how your program talks to outside components - the .NET Framework is a whole new framework built entirely on the best practices of object-oriented programming, without dragging along legacy code from dark days past - the way your objects work with each other is just…smoother…more elegant.
Keep in mind, we’re just now getting to the point where we can see .NET flex its muscles. The first working framework arrived in 2003, and gave us enough to do what we’ve always done, but do it in .NET. .NET 2.0 added some nice features and ways to do things better, and introduced a few new core features like generics (a very nice templating feature). .NET 3.0 brought some new important stuff like Windows Workflow Foundation (you won’t care about it, but big enterprise applications do) and the WPF, which really is the first “power-flex”, IMHO, of the .NET Framework. It is a very nice way of putting together a UI. 3.5, now in beta, really starts to bring stuff to the table that shows off .NET with things you weren’t able to do before (at least as well). Silverlight is impressive. LINQ is damned impressive, and will likely change the way people access their data sources, as well as work with enumerable data in general.
.NET, IMHO, is for real. Making the switch is definitely worthwhile, as it is just a nicer framework to work with and will feel very natural and smooth if you are a solid object-oriented developer. And as the new technology pieces like LINQ start to drop that a powerful framework like .NET enables, you’ll be right there in line to take advantage.