Re: libXO-ification - Why - and is it a symptom of deeper issues?

From: Allan Jude <allanjude_at_freebsd.org>
Date: Sun, 15 Nov 2015 13:23:03 -0500
On 2015-11-15 13:16, Allan Jude wrote:
> On 2015-11-15 13:14, Garrett Cooper wrote:
>>
>>> On Nov 15, 2015, at 10:09, Allan Jude <allanjude_at_freebsd.org> wrote:
>>
>> ...
>>
>>> The big difference is, a json parser isn't going to blow up if a new
>>> field gets added in the middle, and your awk/grep/sed script probably will.
>>
>> That's a plus to those formats, yes, but if someone changes the field name (which can happen today, on a whim, and would go unnoticed for a while because no tests/spec), you'll run into a KeyError in Python or an equivalent error message in your language of choice.
>>
>> Thanks,
>>
> 
> But, if the same change was made to a pure text output, then our 'column
> 3' would suddenly be username instead of ip address, and your program
> would not work at intended either. so at least json would give you a
> warning.
> 
> So, the need for a spec on the output is not specific to encoded
> outputs, changing the output in text is just as disruptful.
> 

Also, libxo now supports the versioning of output, to make it possible
for your json parser to detect when a change to the schema has been made.

-- 
Allan Jude


Received on Sun Nov 15 2015 - 17:23:05 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:01 UTC