Live data from Hacker News

Select Transform: JSON template over JSON

selecttransform.github.io

41–50 of 76 posts

Re: Select Transform: JSON template over JSON

#41
post #15

Gotta love JSON. It's XML without the tools so you get to reinvent everything to pad your resume. XML -> JSON WSDL -> JSON schema XPath -> JSON path XSLT -> JSON template? SOAP -> Swagger and friends One or two decades from now there will be too many tools and things to learn about JSON so another generation will reinvent a new "perfect format for everything". And a new cycle will have started.

Oi... XML wasn't the first format to be used for data interchange and encounter these problems either. At least JSON is designed for data interchange in the first place...

Too many tools? Are you not selective about what tools you use anyways? The field is decades old. Do you program in assembly? Fortran?

Re: Select Transform: JSON template over JSON

#42
post #15

Gotta love JSON. It's XML without the tools so you get to reinvent everything to pad your resume. XML -> JSON WSDL -> JSON schema XPath -> JSON path XSLT -> JSON template? SOAP -> Swagger and friends One or two decades from now there will be too many tools and things to learn about JSON so another generation will reinvent a new "perfect format for everything". And a new cycle will have started.

Yep. I agree. Although maybe XML schema (https://www.w3.org/XML/Schema) -> JSON Schema. And then there's also XQuery, DTDs, namespaces, entities,… which are also in need of reinventing I guess.

Re: Select Transform: JSON template over JSON

#43
post #15

Gotta love JSON. It's XML without the tools so you get to reinvent everything to pad your resume. XML -> JSON WSDL -> JSON schema XPath -> JSON path XSLT -> JSON template? SOAP -> Swagger and friends One or two decades from now there will be too many tools and things to learn about JSON so another generation will reinvent a new "perfect format for everything". And a new cycle will have started.

And it goes on...

    XML comments -> JSON: nah -> YAML
    XML CDATA (multiline raw strings) -> JSON: nope -> YAML

Re: Select Transform: JSON template over JSON

#44
post #36

Earlier quoted context omitted.

I kinda get this criticism, but this is also a bit like lamenting that we write the same libraries for different programming languages. I mean... yeah. Some ideas are good across protocols. That's why they're copied. On a merits-based thing, if you're just looking at XML, it has a lot of things going against it .If someone sends me something "in JSON", I can have a good guess what it'll look like. Not as much luck wi…

Why is it super awkward and how does JSON solve this problem any better?

When you’re designing an XML schema, answering the question “should this be an attribute or a nested elember” is awkward because there is rarely an obvious correct answer.

With JSON, the answer is always a name/value pair.

Re: Select Transform: JSON template over JSON

#45
post #15

Gotta love JSON. It's XML without the tools so you get to reinvent everything to pad your resume. XML -> JSON WSDL -> JSON schema XPath -> JSON path XSLT -> JSON template? SOAP -> Swagger and friends One or two decades from now there will be too many tools and things to learn about JSON so another generation will reinvent a new "perfect format for everything". And a new cycle will have started.

> It's XML without the tools.

XML can be really powerful, but a lot of real users actually don't know how to use XML. Many just use it as an enterprise version of JSON in which case I am happy to just work with JSON, plain and simply.

Also JSON processing can be easily parallelized, because it is easy to express in a newline delimited format (http://ndjson.org/).

Re: Select Transform: JSON template over JSON

#46
post #36

Earlier quoted context omitted.

I kinda get this criticism, but this is also a bit like lamenting that we write the same libraries for different programming languages. I mean... yeah. Some ideas are good across protocols. That's why they're copied. On a merits-based thing, if you're just looking at XML, it has a lot of things going against it .If someone sends me something "in JSON", I can have a good guess what it'll look like. Not as much luck wi…

Why is it super awkward and how does JSON solve this problem any better?

JSON is a lot easier to read.

    {
      "employees": [
        {
          "name": "John Crichton",
          "gender": "male"
        },
        {
          "name": "Aeryn Sun",
          "gender": "female"
        }
      ]
    }
versus

    
      
        John Crichton
        male
      
      
        Aeryn Sun
        female
      
    

Re: Select Transform: JSON template over JSON

#47
post #6

I like the fact that this exists, but I prefer to use jq. I also would like to know in which situation this is preferable to jq.

The jq tool is great. Start using it today as a JSON pretty printer and learn it's more powerful features (selection, object creation) as you need them. The only thing I would like to add to jq would be the ability to use multiple cores.

Re: Select Transform: JSON template over JSON

#48

Hi, my name is Ethan. I'm the creator. I thought I would provide some context on why I wrote this library, and how I'm using this right now. So here it goes: Other than ST.js, I also work on another open source project called Jasonette ( https://www.jasonette.com ), which lets you write an entire native iOS/Android app in nothing but JSON markup. And when you can express the entire app logic--from model to view to co…

This is cool, nice job. And thanks for open sourcing the Jasonette code.

I've done something similar to ST out of the same frustrations at work, but my use case was way more specific, and you took it way farther with better execution.

Re: Select Transform: JSON template over JSON

#49

Earlier quoted context omitted.

Why is it super awkward and how does JSON solve this problem any better?

JSON is a lot easier to read. { "employees": [ { "name": "John Crichton", "gender": "male" }, { "name": "Aeryn Sun", "gender": "female" } ] } versus John Crichton male Aeryn Sun female

Or

    
      
      
    

Re: Select Transform: JSON template over JSON

#50
post #15

Gotta love JSON. It's XML without the tools so you get to reinvent everything to pad your resume. XML -> JSON WSDL -> JSON schema XPath -> JSON path XSLT -> JSON template? SOAP -> Swagger and friends One or two decades from now there will be too many tools and things to learn about JSON so another generation will reinvent a new "perfect format for everything". And a new cycle will have started.

Seems like JSON should have already been overturned. It hasn't and I don't think it will. My personal belief was that XML was kicked out because it allowed this: stuff here

And so you couldn't just READ that, you had to have a parser that fully understood EVERYTHING going on there. JSON won't get namespaces, and therefore it will remain good. We will continue to replace what namespaces did for XML, but will keep that data in its own metadata document, outside the main document. I think that's why JSON won't be replaced as quickly as XML.

Also XML didn't kill XML, webservices (ws-* standards) killed XML.

Post reply on HN