|
Boost : |
From: Hadriel Kaplan (hadrielk_at_[hidden])
Date: 2020-09-23 01:56:47
> On Sep 22, 2020, at 4:12 AM, Gavin Lambert via Boost <boost_at_[hidden]> wrote:
>
> It seems less suited for JSON as configuration file -- while it can parse such files (via common extensions such as ignoring comments and trailing commas) it lacks means to pretty-print and to round-trip the comments, which would be essential if writing back a config file intended for human use. However while supporting this use case would be nice, I don't consider it mandatory.
Out of curiosity, why would you want to round-trip the comments from a config file?
Wouldnât you want to write the comments anew each time you write the file, in case your code version had newer or corrected info? (Iâm assuming the comments are like â// the following setting enables self-destruct (default=false)â)
I would think youâd want such âcommentsâ to come from a schema, not the DOM. (Of course that would require schema-based serialization, or some form of serialization control, but thatâs a separate topic)
Or do you want the human to be able to change comments and/or write their own, that get saved back? We have something like that at my job, but itâs a first-class/normal citizen in the DOM, using normal json-object string field entries named âdescriptionâ. That way users can set descriptions for config objects regardless whether they edit config files by hand, or use a GUI, or whatever.
-hadriel
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk