Live data from Hacker News

Why the Windows Registry sucks technically (2010)

rwmj.wordpress.com

61–70 of 342 posts

Re: Why the Windows Registry sucks technically (2010)

#61
post #44
post #20

> This is a far cry from /etc/progname.conf in Linux. Some of these arguments are not really in good faith. First, this isn't a technical issue with the registry, but with how it's been used over the years and never "refactored" - a distinct issue. Second, I dare you to run "ls /etc" and claim it's not a mess... Besides, most of the post is how anyone with a text editor and admin rights can bork/hack the machine. As…

> Second, I dare you to run "ls /etc" and claim it's not a mess... In principle, sure. But in practice, using /etc to edit configuration data is not that hard, and every Linux user does it all the time. Different software uses different configuration formats, sure (though it's worth nothing that NixOS is doing really clever things to solve that problem), but it's really not that hard or scary. Manually editing the re…

> Manually editing the registry though... That way lies madness. It's much scarier and it's much more fragile.

How... exactly? There's no way to create a syntax error as trivial as you can in config files. How is using regedit or powershell commands more fragile (I understand "scarier" in a way everything you're not used to is scary).

Re: Why the Windows Registry sucks technically (2010)

#62

Earlier quoted context omitted.

> Unix simply doesn't have a "way" in that regard, other than a loose convention to put text files in "/etc". So? The registry doesn't have much of a way either - the actual fields are simply a loose convention. > Every application comes up with its own format. Same with Windows applications - one application might store an IP address as a dotted-octet string, another might store it as a single 32 bit integer. > Pars…

I can’t and shouldn’t be able to write to /etc as an ordinary or guest user. Er-readying values isn’t done usually with apps. You can get corrupted files if two instances fight for the same file. If that’s your thing, please use mongo. Also, please provide support to all the users. Lastly, if you messed up certain configuration or data files, your system won’t boot either on ANY system. Sounds like you’re just one of…

> I can’t and shouldn’t be able to write to /etc as an ordinary or guest user

I don't believe you can. What distribution is this?

Re: Why the Windows Registry sucks technically (2010)

#63

Earlier quoted context omitted.

> The UNIX way is undeniably more flexible since it isn't a virtual filesystem, it is just a filesystem. Unix simply doesn't have a "way" in that regard, other than a loose convention to put text files in "/etc". Every application comes up with its own format. Parsing that file is application-specific. Updating a value in a text file means re-writing the whole file again. It is a technically-inferior approach that ha…

I hate this fanatical love of the UNIX way. I really hate that as of today Windows is the only non UNIX OS. I trully believe that this fact set us back. No more exciting new OSes only boring unix.

I get where you're coming from, but I think the biggest pro for the "UNIX way" is that text on a filesystem extremely accessible. You don't need a specialized tool to read & modify configuration, you just need a text editor. And while there's no standard for how the data is structured, it's usually pretty easy to figure it out from context.

I think it's also really easy to underestimate all the tooling built around text. As soon as you try out some other way, you loose out on version control, diffing, grepping, and a whole bunch of other general tools built for text.

I think the only way to get around this is to build generalized tools for working with binary data as a data structure. The problem with this approach is that now you need to maintain a database that describes every possible binary format, where text editors only really have to concern themselves with ASCII & unicode to be useful for most cases.

Re: Why the Windows Registry sucks technically (2010)

#64

Earlier quoted context omitted.

> Unix simply doesn't have a "way" in that regard, other than a loose convention to put text files in "/etc". So? The registry doesn't have much of a way either - the actual fields are simply a loose convention. > Every application comes up with its own format. Same with Windows applications - one application might store an IP address as a dotted-octet string, another might store it as a single 32 bit integer. > Pars…

I can’t and shouldn’t be able to write to /etc as an ordinary or guest user. Er-readying values isn’t done usually with apps. You can get corrupted files if two instances fight for the same file. If that’s your thing, please use mongo. Also, please provide support to all the users. Lastly, if you messed up certain configuration or data files, your system won’t boot either on ANY system. Sounds like you’re just one of…

Point about /etc is that it’s just one part of “configuration”.

There’s no /etc for users. That’s why we get all these dot.dirs. At least some apps use ~/.config/

Re: Why the Windows Registry sucks technically (2010)

#65

"2. Hello Microsoft programmers, a memory dump is not a file format" This is exactly how Office file formats worked in the good old times. Made things faster (no parsing).

I also honestly doesn't mind this relic of the "old days", and other issues like it brought up in the article. The Registry is still very frequently accessed by Windows, often several times per second. I don't mind that the code to support that is making a ton of assumptions about the details that should never change anyway as it's hidden behind the Registry API. For all I care, keep that code simple and as performant as possible.

Re: Why the Windows Registry sucks technically (2010)

#66
post #39

A point being overlooked by article and commenters: the records in the registry probably use in the order of 10-100 bytes each, while every actual file takes up at least around 1024 (EDIT: maybe more like 4096?) bytes. Putting tiny 'files' into a special format is a no-brainer on the older computers that existed when the Registry was first created. I am assuming this was one of the motivations to create the Registry…

However, by default on NTFS, there will be 4096-N bytes of used space each time the specific hive needs to grow to accommodate those 10-100 bytes (this varied historically if we're talking about NT 4 and below, depending on volume size) due to format cluster size.

That said, it is still smaller than 100 files that are 10-100 bytes each taking up 4096 bytes, though with NTFS, those would be stored in the MFT anyways...

Re: Why the Windows Registry sucks technically (2010)

#67
post #39

A point being overlooked by article and commenters: the records in the registry probably use in the order of 10-100 bytes each, while every actual file takes up at least around 1024 (EDIT: maybe more like 4096?) bytes. Putting tiny 'files' into a special format is a no-brainer on the older computers that existed when the Registry was first created. I am assuming this was one of the motivations to create the Registry…

On ext4, a file of 160 bytes or less (and no xattrs) can be stored inline in the inode[1], so the whole thing takes up 256 bytes (plus 8 + [length of filename] for the directory entry). I don’t think any Unix filesystem did that in 1989, but the problem is not unsolvable, especially given that you are hardly going to use a configuration file to store a single value. NTFS does the same, actually, except it can’t count that low, so you get 1K.

(Of course, before there was the registry there were the textual CONFIG.SYS and WIN.INI, but those were shared and would be easily corrupted by programs trying to modify them manually, which I suspect the registry is a reaction to.)

[1] https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Inli...

Re: Why the Windows Registry sucks technically (2010)

#68
post #20

> This is a far cry from /etc/progname.conf in Linux. Some of these arguments are not really in good faith. First, this isn't a technical issue with the registry, but with how it's been used over the years and never "refactored" - a distinct issue. Second, I dare you to run "ls /etc" and claim it's not a mess... Besides, most of the post is how anyone with a text editor and admin rights can bork/hack the machine. As…

> Some of these arguments are not really in good faith. First, this isn't a technical issue with the registry, but with how it's been used over the years and never "refactored" - a distinct issue. Second, I dare you to run "ls /etc" and claim it's not a mess...

I'd suggest that last bit is not uttered in good faith.

20+ years ago you could install the Microsoft Office suite on the Microsoft OS du jour and you'd find about 12k new registry entries.

You could then uninstall that same Microsoft Office suite from your OS, and ... you'd find no decrease in the size of your registry.

In the same epoch -- if you installed a hundred new applications on your Debian GNU/Linux OS, you may end up with several dozen new directory hierarchies under your /etc directory. If you then uninstalled those applications, the /etc/ entries would be gone. If they weren't, you'd file a report on the Debian BTS and that oversight would be resolved within a few months.

For this reason I think it's disingenuous to claim running ls /etc/ is a mess that's equivalent, in any sense of the word, to the microsoft registry.

Re: Why the Windows Registry sucks technically (2010)

#69
post #4

This is a weird article because you can't talk about the structure of the Windows Registry without talking about INI files [1]. Example: [owner] name = John Doe organization = Acme Widgets Inc. Some comments on the post mention INI files. It's mentioned by commenters in the previous HN submission too. But the Registry was built like it was to easily translate INI files into a semi-filesystem structure. [1]: https://e…

In fact, if I recall correctly, in Windows 95 badly behaved 16 bit Windows apps that tried to put their own INI files in C:\Windows had those file writes/reads silently redirected to a part of the then new Registry.

Re: Why the Windows Registry sucks technically (2010)

#70
post #53
post #39

A point being overlooked by article and commenters: the records in the registry probably use in the order of 10-100 bytes each, while every actual file takes up at least around 1024 (EDIT: maybe more like 4096?) bytes. Putting tiny 'files' into a special format is a no-brainer on the older computers that existed when the Registry was first created. I am assuming this was one of the motivations to create the Registry…

Nobody in their right mind would put every field into a separate file though. (Yes, I do know about qmail.)

Yes but that is the comparison being made, that the registry is like a filesystem and thus should have just been a filesystem. If the suggestion is to put many fields in one file then that's a different suggestion.
Post reply on HN