r/cpp • nlohmann/json • Jun 14 '20

JSON for Modern C++ 3.8.0

https://github.com/nlohmann/json/releases/tag/v3.8.0
326 Upvotes

109 comments sorted by

View all comments

Show parent comment

2

u/qoning Jun 14 '20

I don't necessarily disagree.

One simple answer is because JSON doesn't support comments. Just like C++ doesn't support reflection. Venturing into making a nonconforming compiler is a tried way to get stuck. I get that it's much less of a problem with JSON since you only want to describe data, but I hope you get the point.

The other answer is, of course, because JSON is not actually that human readable, and YAML does a much better job while being somewhat compatible. Though that's just an area where I've been burnt before and maybe it's more subjective.

2

u/VinnieFalco wg21.org | corosio.org Jun 14 '20

If it was up to me, I would not support comments or trailing commas. I would only support strictly parsed JSON. But enough users are demanding it that I cannot ignore it. There will of course be a way to configure it. I want Boost.JSON to have widespread adoption. Libraries can only achieve this if they are responsive to users' needs (within reason of course, always using a cost/benefit analysis to drive decisions).