You are viewing a single thread.
View all comments
72 points
*
Deleted by creator
permalink
report
reply
2 points

I came into the industry right when XML fever had peaked as was beginning to fall back. But in MS land, it never really went away, just being slowly cannibalize by JSON.

You’re right though, there was some cool stuff being done with xml when it was assumed that it would be the future of all data formats. Being able to apply standard tools like XLT transforms, XSS styling, schemas to validate, and XPath to search/query and you had some very powerful generic tools.

JSON has barely caught up to that with schemes and transforms. JQ lets you query json but I don’t really find it more readable or usable than XPath. I’m sure something like XLT exists, but there’s no standardization or attempt to rally around shared tools like with XML.

That to me is the saddest thing. VC/MBA-backed companies have driven everyone into the worst cases of NIHS ever. Now there’s no standards, no attempts to share work or unify around reliable technology. Its every company for themselves and getting other people suckered into using (and freely maintaining) your tools as a prelude to locking them into your ecosystem is the norm now.

permalink
report
parent
reply
6 points

People may hate on SOAP but I’ve never had issues with setting up a SOAP client

permalink
report
parent
reply
4 points
*
Deleted by creator
permalink
report
parent
reply
11 points

And there are some truly magic tools.

XSDs are far from perfect, but waaay more powerful than json schema.

XSLT has its problems, but completely transforming a document to a completely different structure with just a bit of text is awesome. I had to rewrite a relatively simple XSLT in Java and it was something like 10 times more lines.

permalink
report
parent
reply
3 points

And don’t forget about namespaces. Look at formats like HAL and ODATA that try to add HATEOAS onto JSON.

permalink
report
parent
reply
8 points
*
Deleted by creator
permalink
report
parent
reply
1 point

Did you write your transform logic ground-up or use a third-party library? I’m not a Java dev, but I feel like someone has to have already solved this problem in pretty much every language anyone actually uses.

permalink
report
parent
reply
28 points

IMHO: XML is a file format, JSON is a data transfer format. Reinventing things like RSS or SVG to use JSON wouldn’t be helpful, but using XML to communicate between your app’s frontend and backend wouldn’t be either.

permalink
report
parent
reply
21 points
*
Deleted by creator
permalink
report
parent
reply
4 points

The amount of config.jsons I’ve had to mess with…

Yeah, json is not a good config format. As much as xml is not. Please use something like YAML or TOML.

permalink
report
parent
reply
1 point

Of course you can use XML that way, but it is unnecessarily verbose and complex because you have to make decisions, like, whether to store things as attributes or as nested elements.

I stand by my statement that if you’re saving things to a file you should probably use XML, if you’re transferring data over a network you should probably use JSON.

permalink
report
parent
reply
9 points

We were using XML for that before JSON.

permalink
report
parent
reply
3 points

Yes and it is a good thing we don’t anymore.

permalink
report
parent
reply
13 points
*
{ "key": "six",
  "value": 6,
  "comment": "6 is a bad number. Use five." }
permalink
report
parent
reply
28 points
*
Deleted by creator
permalink
report
parent
reply
2 points
*

Yes, it’s a field. Specifically, a field containing human-readable information about what is going on in adjacent fields, much like a comment. I see no issue with putting such information in a json file.

As for “you don’t comment by putting information in variables”: In Python, your objects have the __doc__ attribute, which is specifically used for this purpose.

permalink
report
parent
reply
17 points

Please don’t. If you need something like json but with comments, then use YAML or TOML. Those formats are designed to be human-readable by default, json is better suited for interchanging information between different pieces of software. And if you really need comments inside JSON, then find a parser that supports // or /* */ syntax.

permalink
report
parent
reply
25 points

That’s my biggest peev about JSON actually. No comments!! WTH!

permalink
report
parent
reply
0 points

There’s comments in the specs and a bunch of parsers that actually inore //

permalink
report
parent
reply
3 points
*
Deleted by creator
permalink
report
parent
reply
15 points
*

On one hand I agree, on the other hand I just know that some people would immediately abuse it and put relevant data into comments.

permalink
report
parent
reply
9 points

do they do that in xml? never seen that

permalink
report
parent
reply
5 points

This is why there are none, but I still think it’s dumb. Parsers can’t see comments anyways.

permalink
report
parent
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 4.2K

    Monthly active users

  • 950

    Posts

  • 10K

    Comments

Community moderators