Computing.Net > Forums > Programming > Why does Windows use the Registry .....?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Why does Windows use the Registry .....?

Reply to Message Icon

Name: Eduardo
Date: July 31, 2002 at 04:34:36 Pacific
Comment:

Why does Windows use the Registry instead of using txt files or ini, cfg for storing the settings ?

I just found that is possible to store all setting in a ini file in delphi and not only
some basic settings but all since I don't the
registry of windows and I prefer the old ini system and I can program I decided to make my programs to use only ini files.

Can someone tell me what are pros and cons of
using registry and using ini files?

Thanks

May the source be with you all



Sponsored Link
Ads by Google

Response Number 1
Name: Dr John
Date: July 31, 2002 at 05:41:24 Pacific
Reply:

IMHO, it's part of the M$ security through obscurity approach.
But if anyone else knows better ...


0

Response Number 2
Name: Tom
Date: July 31, 2002 at 07:32:33 Pacific
Reply:

Well, I guess you can backup the entire registry all at once. That would be one advantage over making backups of all your *.ini files. Also, someone who doesn't really know how to use Windows is unlikely to just stumble across the registry.


0

Response Number 3
Name: Jeff J
Date: July 31, 2002 at 07:43:55 Pacific
Reply:

I'll chime-in with my usual long-winded, interesting-to-almost-nobody history bit...

Ending with Win3x, the majority of data was stored in ini files. This proved cumbersome, even though so much data was kept centrally in files like win.ini. Lack of security was another problem. Also, all ini data is kept in string format (.ini files are text files), which can be quite inefficient.

The registry was expanded and blossomed starting with Win95. The registry is a simple database, so it stores binary data directly, which avoids a lot of unnecessary string conversions. Actually, there are really only three data types: integers, strings, and binary blobs (bytes of whatever length), although strings and binaries are further divided into intended-use categories. Security settings can be applied, which prevents just any app from altering critical data. Furthermore, it's more efficient, as long as the registry does not grow too large.

The entire HKEY_CLASSES_ROOT section is devoted to COM, which began heavy promotion around that time. This requires all COM components, such as OLE and ActiveX, to "register" themselves with all sorts of data. Micro$oft also advised software vendors to adhere to guidelines, such as always registering in the "Uninstall" section for unified deinstallation procedures. There's much more, but they also told vendors not to use the registry as a general storage facility, but no one listened.

At first mostly the COM section became bloated, but eventually even Micro$oft's own people ignored their own advice, and its size exploded from a few hundred kilobytes, to tens-of-Megs (I keep mine small, and they're all over 20MB). Due to its simple design, it has become much slower. More than ever, ini files are becoming a good alternative. Micro$oft have even changed their recommendation from "use the registry whenever possible", to "use other methods when the registry is not required".

For my own projects, I avoid the registry and often use ini files. A pro to still using the registry, is that it stores integers and binary data directly, and does not need to convert to and from strings. That only becomes a noticiable factor with larger amounts of data, and few people use binary anyway. It also allows security and a central location, but that's not critical for more modest projects.

Cheers


0

Response Number 4
Name: Eduardo
Date: July 31, 2002 at 07:46:22 Pacific
Reply:

I agree with you Dr John M$ is only trying to
take over to control the user's PC app and games with registry that's one of my reasons
that I don't like it at all but is it better
than the txt mode?.


0

Response Number 5
Name: Jeff J
Date: July 31, 2002 at 08:34:47 Pacific
Reply:

I don't disagree, I just didn't repeat it ;)

If your registry is still small for some reason (like you never added another program to your entire computer), then the registry would be noticeably faster. But for most uses, say below 50KB of text, you'll never notice. Linux still uses text files, and no one calls it slow...


0

Related Posts

See More



Response Number 6
Name: Eduardo
Date: July 31, 2002 at 09:11:06 Pacific
Reply:

But why does linux still use the old system
of text files as config?


0

Response Number 7
Name: junky_toof
Date: July 31, 2002 at 11:24:30 Pacific
Reply:

Because linux has a security model unlike
windows 9x and me and doesn't need obfuscation dword values, binary strings, string values and assorted bells and whistles that are never satifactorily explained to the user, become corrupted easily and generally cause distress.

Most linux (complex) apps have their own conf file. In comparison all registered windows apps have a key/keys in the registry.

Most linux conf files are kept in /etc and
backups are as easy as with registry::backup the entire directory.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Why does Windows use the Registry .....?

VB, nslock www.computing.net/answers/programming/vb-nslock/12147.html

cat command www.computing.net/answers/programming/cat-command/18506.html

Batch to add values to the registry www.computing.net/answers/programming/batch-to-add-values-to-the-registry/14392.html