Hacker News new | ask | show | jobs
by ropeadopepope 2919 days ago
Too many {} and "" for rapid prototyping for me. I've always considered forking it to use yaml instead.
3 comments

For me (I believe few others) the {} and "" are ok as they provide a clear and consistent separation of structure and type at a quick glance, but the comma? That should have been avoided as even in JavaScript semicolons are increasingly being abandoned..
> "even in JavaScript semicolons are increasingly being abandoned"

Disagree. In my experience the trend is in the opposite direction: ASI is broadly acknowledged to cause problems, CoffeeScript turned out to be a trainwreck, and popular defaults for linters tend to enforce semicolons.

Here's a question I've been trying to answer:

Q: How can you conveniently and compactly represent, view and edit JSON in spreadsheets, using the grid instead of so much punctuation?

I’ve come up with a simple format and convenient conventions for representing and editing JSON in spreadsheets, without any sigils, tabs, quoting, escaping or trailing comma problems, but with comments, rich formatting, formulas, and leveraging the full power of the spreadsheet.

It's a work in progress, and I have posted a few messages about it on HN. I'm in the process of writing it up now on Medium (but I'll publish it now so you can read it). I welcome any feedback, criticisms and suggestions, please!

https://medium.com/@donhopkins/representing-and-editing-json...

https://news.ycombinator.com/item?id=17309132 https://news.ycombinator.com/item?id=17360071 https://news.ycombinator.com/item?id=17360799 https://news.ycombinator.com/item?id=17360883

Here's an example spreadsheet -- check out the examples in the different sheets (the tabs along the bottom):

https://docs.google.com/spreadsheets/d/1nh8tlnanRaTmY8amABgg...

Here's a sample implementation, that runs in the browser, node.js, as a Google Spreadsheet extension, etc:

https://github.com/SimHacker/UnityJS/blob/master/UnityJS/Ass...

As well as parsing JSON structures out of raw spreadsheet data, that code also returns a tree of scopes that you can use for syntax coloring or error message feedback, because I'm integrating it with Google Sheets (but the parser is independent of the particular spreadsheet, and just operates on 2D array of strings).

It would be nice to develop it into a macro templating engine for JSON (or higher level structures that happen to be represented as JSON). Kind of like Genshi (the XML/Python templating system that I’ve used a whole lot and love for its simplicity).

https://genshi.edgewall.org/

Cool! This should be a top-level "Show HN" post.
Right? One time my boss asked me to do something in JSON but I explained to him I simply couldn’t work with JSON because of the braces and quotes. JSON is practically unusable.
Good lord, wait until someone shows you computers. All the ones and zeros. A real mess we all can agree.