Friday, August 31, 2007

Windows Registry

The Windows Registry has been a miracle of engineering.  It is a miracle that it hasn't collapsed under it's own weight.


Originally the Windows Registry was the solution to the .ini file.  Instead of storing information in .ini files located all over the hard drive this information could be placed in a central registry and accessed from all applications.  So, what's wrong with this?  Well, like a pendulum that swings from one extreme to another, the concept of the Windows Registry was an extreme.  Yes, there are things that should be placed in the Registry.  Things that are common to one or more applications should place that information in the Registry. Things that aren't probably shouldn't be stored in the Registry.


Like all things, the pendulum is swinging rapidly back the other way.  Using .NET we have application configuration files and web configuration files that are placed in the same directory as the application, pretty much neglecting the Registry.  Is this a good thing?  Well, in many respects, yes.  It gets people thinking about what should be in the registry and what shouldn't be in the registry.


Is it as simple as "Registry=Bad.  Config files=Good"?  No, not really, but it is close to the truth.  Unless you need to put something in a location that multiple applications need to access you should probably use a configuration file.  It is simple.  It is easy to deploy.  It works.

No comments: