Live data from Hacker News

How to build cross-platform mobile apps with JSON

medium.freecodecamp.com

31–40 of 43 posts

Re: How to build cross-platform mobile apps with JSON

#31

If it can be done in JSON it can also be done in YAML. I pick YAML.

Have you read the specs for both? You should read the JSON spec. It will take you ten minutes. The YAML spec ( http://yaml.org/spec/1.2/spec.html ) may take you a little longer. . .

S-expressions will take you ten seconds still nobody uses them. YAML is made to simplify the lives of the reader and the writer, not the parser. Let the parser suffer, let the coder rejoice. You pick your own level of suffering, I pick mine. Deal?

Re: How to build cross-platform mobile apps with JSON

#32

Earlier quoted context omitted.

Have you read the specs for both? You should read the JSON spec. It will take you ten minutes. The YAML spec ( http://yaml.org/spec/1.2/spec.html ) may take you a little longer. . .

S-expressions will take you ten seconds still nobody uses them. YAML is made to simplify the lives of the reader and the writer, not the parser. Let the parser suffer, let the coder rejoice. You pick your own level of suffering, I pick mine. Deal?

What language you use doesn't really matter much when you can easily transform one into another. I think that's exactly the case with JSON and YAML.

Re: How to build cross-platform mobile apps with JSON

#33

Earlier quoted context omitted.

If the idea is to reduce verbosity, I'd much prefer CSON. YAML just has way too much "magic" parsing behavior.

Not bad, a second close just behind YAML in my picks. Nothing can beat this: name: Taylor Swift Absolutely nothing, no matter how you dress it.

I prefer

    name "Taylor Swift"
which is how JSONY works (which was an experiment ingy and I put together)

Re: How to build cross-platform mobile apps with JSON

#34

Earlier quoted context omitted.

Sure. S-expressions[1] are a notation for nested data structures. They can be used to spell out data as well as code. In fact both code and data look the same when expressed using s-expressions.[2] When the article's author describes both code and data using JSON, it sounds a little strange to me. While JSON is capable to describing nested data structures, JSON's syntax is much more verbose than s-expressions. I feel…

Although I'm also skeptical of coding in JSON, s-expressions are pretty close to a JSON subset (with the caveat that everything needs to be quoted). (x . (y . (z . NIL))) ['x', ['y' , ['z', null]]]

The first one is the flat list (x y z); the JSON one seems to be equivalent to (x (y (z nil))).

Re: How to build cross-platform mobile apps with JSON

#35

Earlier quoted context omitted.

Sure. S-expressions[1] are a notation for nested data structures. They can be used to spell out data as well as code. In fact both code and data look the same when expressed using s-expressions.[2] When the article's author describes both code and data using JSON, it sounds a little strange to me. While JSON is capable to describing nested data structures, JSON's syntax is much more verbose than s-expressions. I feel…

Although I'm also skeptical of coding in JSON, s-expressions are pretty close to a JSON subset (with the caveat that everything needs to be quoted). (x . (y . (z . NIL))) ['x', ['y' , ['z', null]]]

In Lisp, (x x x) denotes a list which contains three elements which are pointers to the same symbol object.

Re: How to build cross-platform mobile apps with JSON

#36
post #26
post #20

JSON is the new XML. Except XML was actually designed to have semantics, while similar attempts in JSON are just hacks. In general, JavaScript is becoming the new J2EE. Ambitious ideas, clueless implementations, insane complexity.

1. OP article has nothing to do with JavaScript. 2. It's not like the JS community is anti-XML, most JS libs/frameworks still use HTML/XML markup for rendering. 3. The JS community is vast and diverse - generalisations around 'clueless implementations, insane complexity' don't make a lot of sense.

>It's not like the JS community is anti-XML, most JS libs/frameworks still use HTML/XML markup for rendering.

Its pretty anti-XML outside of node. Pure-js solutions for xml are not as great as built in features other languages provide, while JS only natively does JSON.

>generalisations around 'clueless implementations, insane complexity' don't make a lot of sense.

When you are creating languages that compile to JS and adding entire markup ontop of it along with literally hundreds of dependencies in any average project, JS has plenty of insane complexity.

Re: How to build cross-platform mobile apps with JSON

#37
post #26

Earlier quoted context omitted.

1. OP article has nothing to do with JavaScript. 2. It's not like the JS community is anti-XML, most JS libs/frameworks still use HTML/XML markup for rendering. 3. The JS community is vast and diverse - generalisations around 'clueless implementations, insane complexity' don't make a lot of sense.

>It's not like the JS community is anti-XML, most JS libs/frameworks still use HTML/XML markup for rendering. Its pretty anti-XML outside of node. Pure-js solutions for xml are not as great as built in features other languages provide, while JS only natively does JSON. >generalisations around 'clueless implementations, insane complexity' don't make a lot of sense. When you are creating languages that compile to JS an…

> When you are creating languages that compile to JS and adding entire markup ontop of it along with literally hundreds of dependencies in any average project, JS has plenty of insane complexity.

Like parent said, this project doesn't compile to JS. It's simply a JSON to native mapping.

Re: How to build cross-platform mobile apps with JSON

#38
post #26

Earlier quoted context omitted.

1. OP article has nothing to do with JavaScript. 2. It's not like the JS community is anti-XML, most JS libs/frameworks still use HTML/XML markup for rendering. 3. The JS community is vast and diverse - generalisations around 'clueless implementations, insane complexity' don't make a lot of sense.

>It's not like the JS community is anti-XML, most JS libs/frameworks still use HTML/XML markup for rendering. Its pretty anti-XML outside of node. Pure-js solutions for xml are not as great as built in features other languages provide, while JS only natively does JSON. >generalisations around 'clueless implementations, insane complexity' don't make a lot of sense. When you are creating languages that compile to JS an…

[deleted]

Re: How to build cross-platform mobile apps with JSON

#39

Earlier quoted context omitted.

If the idea is to reduce verbosity, I'd much prefer CSON. YAML just has way too much "magic" parsing behavior.

Not bad, a second close just behind YAML in my picks. Nothing can beat this: name: Taylor Swift Absolutely nothing, no matter how you dress it.

Right, but the problem is YAML parsers are crazy hard to implement correctly/safely. Its spec is an order-of-magnitude more complex than JSON.

Re: How to build cross-platform mobile apps with JSON

#40
post #9

So why JSON of all things? When I reached the "write a full declarative program in JSON" section I was internally screaming "but s-expressions!"

Same thinking, I expect, that gave us XSLT.

XSLT was proposed as a limited transformation language, and actually (still) does a very good job of that. And since we're doomed to repeat the past we now see various XSLT-ish languages being developed for JSON/YAML/etc, relearning all the edge cases that drove XSLT into its current form.

On the other hand, students of the past will notice that Jsonette looks awfully similar to Ant build files, which sucked. JSON/XML/YAML is a horrible way to construct general-purpose programs. Computing languages exist for a reason.

Post reply on HN