std.data.json formal review

via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 14 08:29:11 PDT 2015


On Friday, 14 August 2015 at 15:11:41 UTC, Steven Schveighoffer 
wrote:
> And that would be possible here. JSON file format says nothing 
> about how the data is stored in your library. But again, not 
> important.

It isn't important since JSON is not too good as a config file 
format, but it is important when considering other formats.

When you read a JSON file into Python or Javascript and write it 
back all dictionary objects will be restructured. For instance, 
when a tool reads a config file and removes attributes it is 
desirable that removed attributes are commented out.

With JSON you would have to hack around it like this:

[ {fieldname1:value1}, {fieldname2:value2} ]

Which is ugly.

I think it would be nice if all D tooling standardized on YAML 
and provided a convenient DOM for it. It is used quite a lot and 
editors have support for it.



More information about the Digitalmars-d mailing list