Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Better question: why aren't there comments? It's 2022 and there are still no comments in regedit?


Backwards compatibility. I'm not remotely kidding here. There are still programs that directly parse these files instead of using Windows' APIs and the format itself is fragile, and in the 90's the concern was more of disk speed access (where comments will slow down reading of registry files) meant that the designer have opted to not put comments (as you expect from that time that the manual is literally a book or a separate CHM or TXT file, with user comments stored at the "Notes" part of the book or another separate TXT file). It's similar to the binary DOC format pre-Word 97 which includes actual C pointers (so it's less of a document format and more of a snapshot of Microsoft Word memory).

Edit: Some have noted Group Policy and its note field. I've disqualified that because it's not readily available in Home versions of Windows, because third-party applications are often not bundled with the necessary ADM/ADMX files necessary (which you might also want to comment), and the fact that the parent commenter disqualified the text-based REG files (which supports comments).


This has sort of existed since Windows NT 4.0 days in the form of Administrative Templates, with the newer "ADMX" format shipping with Windows Vista / Server 2008:

https://docs.microsoft.com/en-us/previous-versions/windows/d...

https://admx.help/

https://jeffpar.github.io/kbarchive/kb/225/Q225087/


For something that wasn't meant to be interacted with by humans on the regular, I can see why you wouldn't include comments.


Classic mistake. The creators of JSON thought the same thing, and that decision is here forever to annoy us.


Human interaction with JS kinda sucks regardless. It's a good lowest common denominator of data, that is somewhat decent for hand editing when needed.

Comments would be nice, but they'd get lost in loading and dumping.

Moving beyond pure hierarchy, and having first class ordering, where comments are real data objects that survive import would probably be the way to go.

Something like slightly less verbose XML might be a great thing.


The registry is the raw database. The Policy Editor is the human interface with comments and other niceties.


Because you can’t automatically manage a configuration database that has comments. If the applications can remove and recreate their registry values and keys there is no way to keep comments associated with these things.


You can make a string value with an unused name and use that as a comment, if that's what you're referring to?


This idea is also the recommended workaround for JSON, and it is equally wrong there. For one thing, then you can only comment the key/folder/object, not the individual value.


What stops you from creating a string key called Comment? :)


Because the registry is a database. Why would you put comments in a database?

Regedit is a table editor of that database. So again, would you insert random records into a database as comments?

Now if you're asking "why aren't there comments in .REG files" the answer is there are, prefix it with a semicolon (not well documented):

https://docs.microsoft.com/en-us/previous-versions/windows/e...

Probably wouldn't have been difficult to guess though, since they follow the .INI file syntax (which ironically is now used by SystemD)


> Because the registry is a database. Why would you put comments in a database?

A database stores whatever data is necessary for the application. If comments for application records are needed, that includes comments.

A self-documenting registry where applications registered user information about keys that they used (whether or not the application populated them) as well as apps populating data for keys, so that navigating to a key in the UI would provide you with the documentation from any app or apps concerned with that key as well as the ability to review and edit the data value would be awesome.


The registry is as much a database as it is a very large config file, and config files, as you've rightly observed, have comments.


Oracle has user/all/dba_tab_comments and user/all/dba_col_comments.

The only places in my legacy databases where these are populated emerged from the Erwin data modeler. We are lazy in not populating them with new tables.

I wonder if SQLite has something similar.


Ms SQL has extended properties, particularly the ms_description one that is exposed in ssms. But that's comments on database columns and objects, not data points.

Which highlights the difference between the registry and an rdbms. In an rdbms you can absolutely comment the columns and tables, just not the rows and individual data points.

In the registry, the data isn't tabular. Every data point has a corresponding field name. That name absolutely would support a comment in sql.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: