Hi, On 13/11/17 17:44, François Kooman wrote: > On 11/12/2017 10:42 PM, Gert Doering wrote: >> On Sun, Nov 12, 2017 at 12:21:06PM -0500, Selva wrote: >>> One of the niceties of JSON is its readability which is greatly reduced >>> if formatted without line breaks. >> >> +1 >> >> the difference in efficienty is not large, but "human readability for >> manual proofreading" is good. > > Selva, Gert, > > You know, the funny thing is that my main reason for implementing JSON > support for status was to have it easily _machine_ readable, for higher > level programming languages where JSON is "first class citizen", and not > primarily human readability. Besides you could easily do this to make > JSON human readable: > > $ cat /path/to/status.json | python -mjson.tool > > Thinking some more about it now, it doesn't really make sense to > implement JSON at all, because CSV _is_ actually meant to be machine > readable and a lot more efficient in the amount of data it uses (much > less duplication). So it seems my reasons for implementing JSON support > seems to completely miss the point. For machine readable output it would > make more sense to use a binary format instead of JSON. > > What do you guys think? Are there any other reasons to implement JSON > support?
Although JSON is a bloated language (meaning that there is lots of overhead next to the data itself), I think that it allows you to easily extend the objects being sent back and forth with a fairly high chance to keep backwards compatibility. This is barely true for csv. A binary presentation per se is not bad, but then you need to make sure that the format is properly encoded/decoded (especially if the data is transferred across the network from/to different platforms) and this can be error prone. Honestly I did not read the rest of the thread, but if this data is supposed to be exposed through an API (i.e. REST API or any other interface) and it is meant to travel across the network, I wouldn't mind seeing the JSON format being used. JSON consumers nowadays are extremely easy to implement compared to others. Regarding the JSON "prettiness", I think that printing it in a nice readable format makes it just extremely easy to debug and possibly spot errors on the fly (even when not searching for them). For this reason I'd rather add a couple of tabs and \n to make it easier to read. my2cents Cheers, -- Antonio Quartulli
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel