Re: [PATCH 0/2] routines to generate JSON data
- From
- Jeff Hostetler <git@jeffhostetler.com>
- Date
- Mar 19, 2018, 17:31 UTC
- Message-ID
- <d814130f-dce7-4513-02a5-469c97464715@jeffhostetler.com>
- In-Reply-To
- <CA+P7+xpGWZaFMWhN72beUVaV_HuECAAEYhf+UT-CPZUV+Gew4Q@mail.gmail.com>
On 3/17/2018 3:38 AM, Jacob Keller wrote:
Show 16 quoted lines
> On Fri, Mar 16, 2018 at 2:18 PM, Jeff King <peff@peff.net> wrote: >> 3. Some other similar format. YAML comes to mind. Last time I looked >> (quite a while ago), it seemed insanely complex, but I think you >> could implement only a reasonable subset. OTOH, I think the tools >> ecosystem for parsing JSON (e.g., jq) is much better. >> > > I would personally avoid YAML. It's "easier" for humans to read/parse, > but honestly JSON is already simple enough and anyone who writes C or > javascript can likely parse and hand-write JSON anyways. YAML lacks > built-in parsers for most languages, where as many scripting languages > already have JSON parsing built in, or have more easily attainable > libraries available. In contrast, the YAML libraries are much more > complex and less likely to be available. > > That's just my own experience at $dayjob though.
Agreed. I just looked at the spec for it and I think it would be harder for us to be assured we are generating valid output with leading whitespace being significant (without a lot more inspection of the strings being passed down to us).
Jeff