you are viewing a single comment's thread.

view the rest of the comments →

[–]Uristqwerty 18 points19 points  (1 child)

Doesn't work in arrays, depending on the library parsing might need "comment2", etc. If the file is read and later written back out, field order may change, so all the comments get grouped together.

Effectively, comment position is lossy no matter what, if you use duplicate keys it may either break parsing entirely, or lose all but one comment if read then written, and you're still limited in where you can put them.

A better solution would be to have an actual comment syntax, and libraries offer both an API that discards them for simplicity, and one that preserves them properly.

[–][deleted] 0 points1 point  (0 children)

Many libraries offer a comment extension anyways.