Why have a registry?
-
Is there a reason for the bloated registry in windows? Why even have one? Everything I can store in the registry I can store in an ini file. The one reason I can think of is to let other programs know what directory your app is in. A single global list would suffice. Any thoughts? Darroll Not one person lives in the present. Only the past. I can prove it.
Because the registry is setup to allow for roaming users in network domains. Your INI and XML files won't do that automatically. It also provides a central configuration location. Which in theory should be easier to backup. The alternative is 100000000000 different bloated ini/xml files everywhere. Pick your hell... Tim Smith "Programmers are always surrounded by complexity; we can not avoid it... If our basic tool, the language in which we design and code our programs, is also complicated, the language itself becomes part of the problem rather that part of the solution." Hoare - 1980 ACM Turing Award Lecture
-
Didn't think of using XML, is there a tutorial on this? A guide? I think that this would be a good idea. Better than an ini. Darroll Not one person lives in the present. Only the past. I can prove it.
I have one, http://www.ltpb.8m.com/tutorial/XMLOptions.html[^] -Steven
Visit Ltpb.8m.com
3D Image Library: Ltpb.8m.com/Image -
Because the registry is setup to allow for roaming users in network domains. Your INI and XML files won't do that automatically. It also provides a central configuration location. Which in theory should be easier to backup. The alternative is 100000000000 different bloated ini/xml files everywhere. Pick your hell... Tim Smith "Programmers are always surrounded by complexity; we can not avoid it... If our basic tool, the language in which we design and code our programs, is also complicated, the language itself becomes part of the problem rather that part of the solution." Hoare - 1980 ACM Turing Award Lecture
Tim Smith wrote: Which in theory should be easier to backup. Exactly !! Regardz Colin J Davies
Sonork ID 100.9197:Colin
You are the intrepid one, always willing to leap into the fray! A serious character flaw, I might add, but entertaining. Said by Roger Wright about me.
-
Is there a reason for the bloated registry in windows? Why even have one? Everything I can store in the registry I can store in an ini file. The one reason I can think of is to let other programs know what directory your app is in. A single global list would suffice. Any thoughts? Darroll Not one person lives in the present. Only the past. I can prove it.
COM. Can you imagine how slow the system would be if it looked up GUIDs in a non indexed ini file ? The registry is a tree structure, and therefore much faster than an ini file. ini files are evil. Christian Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
-
COM. Can you imagine how slow the system would be if it looked up GUIDs in a non indexed ini file ? The registry is a tree structure, and therefore much faster than an ini file. ini files are evil. Christian Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
Why are ini files slow? All you have to do is read in the file, find the key, then find the data in the value you need. CString str = GetFile(); // ok sloppy shorthand int index = str.Find("Value", str.Find("Key",0)); str.Mid(index + 5,str.Find("\n",index)); It is my understanding that String functions in memory are very fast. So Why are INI files evil? Darroll Not one person lives in the present. Only the past. I can prove it.
-
Why are ini files slow? All you have to do is read in the file, find the key, then find the data in the value you need. CString str = GetFile(); // ok sloppy shorthand int index = str.Find("Value", str.Find("Key",0)); str.Mid(index + 5,str.Find("\n",index)); It is my understanding that String functions in memory are very fast. So Why are INI files evil? Darroll Not one person lives in the present. Only the past. I can prove it.
Darroll wrote: It is my understanding that String functions in memory are very fast. So Why are INI files evil? Because your ini file does not live in memory, it lives on disk. Why do people like Oracle and Microsoft with SQL Server not store their databases as flat 'ini' type files ? Because if they did, you'd need to search the entire file to find a record. It's like a CArray or vector, you start at the top and work to the bottom. A CMap or map, on the other hand, is a sorted tree, and so you never have to search the entire file, each search halves the number of records you need to search. That's just one way of storing data more efficiently than a flat file. Christian Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
-
Is there a reason for the bloated registry in windows? Why even have one? Everything I can store in the registry I can store in an ini file. The one reason I can think of is to let other programs know what directory your app is in. A single global list would suffice. Any thoughts? Darroll Not one person lives in the present. Only the past. I can prove it.
The registry was created to get away from .ini files and the pain they caused. Like most of MS's technologies they started out with a good idea, then created a half assed implementaion that allows bloat and doesn't provide an easy way to purge old keys, track changes, etc. One of the main uses of the registry is to hold COM GUIDs that the system needs to know about. All that being said, do use the registry for storing configuration info and personal settings. You are just asking for pain if you attempt to use .ini files or come up with a home brew solution.
-
I have one, http://www.ltpb.8m.com/tutorial/XMLOptions.html[^] -Steven
Visit Ltpb.8m.com
3D Image Library: Ltpb.8m.com/Image -
Didn't think of using XML, is there a tutorial on this? A guide? I think that this would be a good idea. Better than an ini. Darroll Not one person lives in the present. Only the past. I can prove it.
Try my article here: http://www.codeproject.com/useritems/XMLSettings.asp[^]
Jason Henderson
start page
articles
"If you are going through hell, keep going." - Sir Winston Churchill -
Why would an example for XML config files not use the XMLDOM parser? It might be overkill so I'll grant some lee-way. You have any thoughts on this? -- If it starts to make sense, you're in a cult.
I just prefer to use the code that I already wrote, an XMLEditor and a CMS. Also the function that is listed on the tuturial recieves the contents within the specified tag (which you should know the tag if you are using the XML file for the options.). I just haven't found a need for the XMLDOM, nor any information about it. -Steven
Visit Ltpb.8m.com
3D Image Library: Ltpb.8m.com/Image