Friday, February 20, 2009

Supersize Me

Recently, while preparing for a new engagement, I was re-familiarizing myself with Oracle because the application(s) I will be working with require an RDBMS and the client has chosen Oracle.

So, because I have experienced Oracle installations in the past, I decided not to install Oracle on my laptop. Instead, I planned to install it on a virtual machine (vm).

Now if you've ever worked with vms, you know the first thing I had to do was create the vm... (if you haven't worked with vms, I recommend you check out VMWare). Just for completeness, the vm system was planned to be Windows 2003 R2, the latest version of Oracle, and Vignette Records and Documents v7.3.1.

Since we use vms quite frequently, I have a set of commonly used "base" vms with the operating system (OS) already installed (and a few development tools like Adobe PDF Reader, WinZip, and Eclipse), so I just started with that. I built these vms with 10GB hard disk. That makes the vm fairly easy enough to copy (to either a shared drive or a 16GB flash drive and large enough to load the software we work with. So far, that has been workable... that is, until now.

The Oracle 11g download (Windows 32-bit) is 1.73 GB in size.. AND, it's a ZIP file. That's the installation file! I'll spare all the details of getting this monster software installed. However, to get it into the vm, unzipped, and installed, I had to remove all 'other' software installed except the OS and when it was done (btw, I installed the standard edition, not the enterprise edition), I was left with less than 200 MB free! After deleting the ZIP & installation files and configuring a new, basic database within Oracle, I was left with 1.67 GB free out of 10 GB. That's right, just the OS and the 'standard' edition of Oracle - more than 8GB disk space required.

And there's wonder in the industry why software development is so difficult...

Exactly how much is 8 GB anyway? Does anyone really have a good feel for this number? Or is it just a number? Trying to wrap my head around 8 GB reminds me of my high school days trying to understand Avogadro's number. In case you don't know what that is, look here. Avogadro's constant is 6 x 10e23... that is 600,000,000,000,000,000,000,000 (or about that much).

So, 8 GB seems relatively small compared to that, but still it's a hard number to conceptualize... 8,000,000,000 bytes (and a byte is 8 bits). So, this is the equivalent of about 8,000 uncompressed novels or about 10 2hr movies.

When I think back on my career, I'm floored by these numbers - these sizes. We have definitely supersized ourselves in the IT industry. We need to go on a diet, but not just a diet of size - a diet of complexity. If we did that, software quality would go up because there is a direct correlation between complexity and software quality.

Stop supersizing your code.

Thursday, February 05, 2009

Windows Registry Nightmares

I remember Windows (and DOS) before it had a registry... Do you remember? Remember the the Win.ini and the System.ini files (and Autoexec.bat and Config.sys)? Seems like a lifetime ago - and for some of you I guess it is...

At the time, configuring Windows sure was simpler. Simpler and easier. Simpler and easier and LESS RISKY.

Not so anymore... Today, the venerable INI files have been (mostly) replaced by the Windows Registry.

Have you tried editing the Windows registry manually. Go ahead. On Windows XP or Vista, try to uninstall an application - or better yet, a Windows installed service - manually. I dare you!

What's that you say? I must be crazy? That's insane? No one is dumb enough to try that? Well, I tend to agree with you. I consider myself a fairly experienced PC/Windows guy, but even I think twice before using REGEDIT.

But I do use REGEDIT.
Why? Because I have to.
Why? Because lots of software uninstalls poorly...
And I'm fed up with it!

This behavior reminds me of the bad 'ole days of "DLL hell". Anybody remember that? Where a software would install a DLL with the same name as a system DLL, or worse, it would install a system DLL that was the wrong version? Inevitably, it would screw up your system (in weird ways) and was masterfully difficult to troubleshoot.

And no, "DLL hell" hasn't gone away, but it's gotten better - or at least now it has to share the infamy with "Windows registry purgatory" (Wrp).
(Made that up myself... you think it'll catch on?)

For those of you who have not experienced Wrp (pronouced 'warp'), let me shed some light on this phenomenon. But first, read this to see what the Windows registry is so I don't have to spend a week relating my limited knowledge of the Windows registry.

In the Wikipedia article, near the bottom, there's a somewhat inconspicuous bulleted list item under the heading Advantages and disadvantages:

  • "Any application that does not uninstall properly, or does not have an uninstaller, can leave entries in the registry. Over time the computer suffers "Software Rot" as the registry fills with left-over and possibly malfunctioning entries."

This is the nasty bugger... This is the root of my pain.

Why doesn't software written for the Windows platform clean up after itself well? Is it really that hard?

Ok, yes, it is kinda hard - especially if you register COM controls and/or Windows services. But, that should be part of the price of selling software on the Windows platform in my opinion.

This is the kind of software engineering I alluded to when I wrote about "Leaf Blower Coders". Face it,

the job is not done until all can be undone.

So, why is this a pain? I mean, really... all that's happening here is that there are orphaned registry entries that can't *do* anything and while it may bloat the registry, it's just a nuisance, right?

WRONG! Very WRONG!

As consultants, integrators, and custom solution providers, it is often common for clients to ask us to install software for them - usually on DEV or QA platforms. We act as experts and the client watches and learns as we show them how their software is loaded and configured. It's also not uncommon for us to be asked to *re-install* software that has been installed incorrectly, or we ask the client to *re-install* software themselves to insure that they have learned how to do it correctly. And THAT is when the uninstall becomes oh-so important.

It's in these *re-install* moments that orphaned registry entries can wreak havoc, I mean REALLY BAD BAD juju, on your day. I won't bore you too much more with details because I've rambled enough already, but orphaned registry entries (and really, *any* orphaned stuff) left hanging around after an official uninstall will cause untold problems with re-installing software - nearly always ending up with a failed install (or worse, an install that appears to work, but you don't find out it really doesn't work until much later after you've spent too much time trying to figure out why the software seems buggy).

So, here's my newest plea to Microsoft platform software vendors...

Please, please read the whys & wherefores of the Windows registry design and use - here, here, and here are good places to start. Take the time to map out all the registry entries your software makes when it installs and over the lifetime your software is installed (as well as any other configuration changes your software makes to the system as a whole). Document that in your software documentation. And then create a stand-alone uninstaller that reliably, repeatably removes them. We, your users and partners, need help to keep the Windows registry beautiful and tidy for future generations. Thank you.