boblq wrote:
Looks good to me. It is an alternative to XML
for data exchange.
http://www.crockford.com/JSON/xml.html
Comments?
*flush*
Ah, s-expressions reinvented ...
http://www.crockford.com/JSON/example.html
If you really need the density, ASN.1 is the correct solution.
Everybody whines about XML. I don't understand why.
Actually, I do:
First, parsers are *hard*. Every idiot CS major thinks he a can write a
parser for his "little language". They are all wrong. Every parser
they create is a broken piece of sh*t. It doesn't get debugged; it
doesn't get tested; it gets thrown out in 12 months for another one. It
is almost certainly written in convoluted Perl regexps like the last
one. It also almost certianly retains all of its bugs while adding
whole new classes of yet more bugs. Lather, rinse, repeat.
XML *forces* these morons to have to interface with a structured,
debugged parser. SAX and DOM have their faults, but at least they get
debugged. Watching programmers writhe in agony because the XML parser
threw an exception on a boundary case that their puny little minds are
too narrow to anticipate is a most rewarding experience.
Second, internationalization is hard. How many ways are there to spell
Tchaikovsky? The same morons from above get *forced* into dealing with
this kind of crud with XML when they bump into another program which
refuses to accept that Author, Composer, etc is a unique key. Oops.
And the whole fact that XML *specifies* Unicode is beautiful--no more
slacking off and only accepting ASCII or, worse, only accepting letters
and digits.
Third, XML parsers *complain* when you feed them garbage. If you don't
get your formatting and nesting correct, most XML parsers are free to
dump your crud into the bitbucket any way they please. And herein lies
the source of the XML verbosity that everybody complains about--balanced
close tags. Syntax errors almost always *immediately* cause parsing
errors because they tend to bump into unbalanced tags; no silent
degradation here--I approve. The same nitwits who think they can write
parsers and can't deal with the fact that almost nothing in real life is
a useful unique key desperately want XML parsers to be "liberal in what
they accept" so that they don't have to debug their XML generation code.
Hogwash! Clap them in irons for promulgating their dreck amongst the
public!
I will happily accept the restrictions that XML places upon me because
*I don't find them to be restrictions*. I wind up putting in the work
to deal with this kind of stuff anyway. I can avoid most of the gnarly,
nasty corners of XML (namespaces and schemas/DTD's) while still
retaining most of the advantages all while knowing that the gnarly,
nasty stuff is available if I really need it.
In return, the brainless twerps who populate software fantasyland with
multitudes of domain specific rat droppings get whipped mercilessly by
pissy, picayune XML parsers in a satisfyingly messy display of bondage
and discipline that provides long-lasting warmth for the cockles of my
heart.
Ye shall pay for thine transgressions,
-a
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg