[Info-vax] JSON, was: Re: First ship poll: When will the first native x86-64 compilers ship ?
Jan-Erik Söderholm
jan-erik.soderholm at telia.com
Mon Apr 18 04:35:25 EDT 2022
Den 2022-04-18 kl. 01:27, skrev Arne Vajhøj:
> On 4/17/2022 6:55 PM, Simon Clubley wrote:
>> On 2022-04-16, Richard Maher <maher_rjSPAMLESS at hotmail.com> wrote:
>>> I work every year with wankers that don't understand relational DBs and
>>> SQL and insist on some shit like Entity Framework to try to turn a table
>>> into a class(es) and other wankers that demand a "model" because they're
>>> upset JSON is just a String :-(
>>
>> But JSON isn't a string. That would be like calling a database just
>> a stream of bytes.
> >
>> The string is just the backing store for the data held within and you
>> certainly do need a parser, and maybe some object model that you can
>> iterate through, to assign meaning to the contents of that string.
>
> Yep.
>
>> Having said that, I do think that sometimes people do go overboard in
>> using whatever is the fashion of the month instead of just a nice simple
>> parser that maybe just builds an object tree that you can iterate through
>> to extract the data you need.
>
> If you use JSON then you do not need to write that parser but can
> just pick one and use it - for almost all languages - and for
> the more popular languages there are multiple parsers to choose from.
>
> Arne
>
We have some Cobol cases where the data sent to "the other side"
was defined as JSON. The structure was fixed and the data parts
all had known and fixed sizes (or could be blank filled), so it
was easy enough to define the JSON structure as a Cobol record
with variables for the data parts and just "fill-in-the-blanks".
I guess that you could call that "a astring". With a special format
but still a (kind of) string.
For some cases (the recevier requested UUID version 4 while VMS
only supports Version 1), so we used Python and the JSON support
it has. On the communication channel (an MQ queue) it is still
a string of characters.
And in another case we got an XML structure, but it had a very
well known format so the data we needed could just be fetched
from well know positions in that "XML string".
So you can very well use JSON or XML *in specific cases*
without the fancy parsers.
I'm not against parsers, of course. In another case we receive
a large and very dynamic XML structure and there the parsing
and looping constructs in Python was very handy to read it.
More information about the Info-vax
mailing list