Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

They also make JSON generation by machines much easier, and don't complicate the parser. [1]

[1] Source: I've written a JSON parser from scratch and think it would be valuable



More importantly, they make it possible to have not-ugly documents (commas where they belong, after the clause they extend) work well with version control and merging.

    -   "blah"
    +   "blah",
    +   "blorp"
is far uglier than any trailing comma ever has been.


Is that a problem that should be solved on a data format level or a version control level?


Do you have a proposal to achieve solving it at the version control level that doesn't require either a complete paradigm shift in programming and data formatting langauges to everything being trivially an AST or embedding knowledge of every format ever invented to your version control?

Because it seems a lot easier to just design newer languages to be friendlier to version control than either of those. JSON has little excuse here, even when it was 'invented' it was a bad idea to simply run it through eval and pray it had nothing malicious or damaging in it, so compatibility with IE6's stupid parser wasn't really all that special. Never mind that it didn't take off as a really popular format until well after that was a concern.


if text editors can syntax highlight why can't version control systems syntax version?


If you store JSON in a version control system, then it is usually hand-edited JSON. (If it is generated programmatically at runtime, then the data is in a database.)

And if a file is hand-edited, it's format should have niceties that make hand-editing more pleasant, like optional trailing commas, and comments.

By making the format more suited to hand-editing, you also make it better for diffing and VCS.


    require([
    -   "blah"
    +   "blah",
    +   "blorp"
    ], function () {
AngularJS templates often can involve JSON structures for <select> and other UI junk.

It'd be great if a backend could serve JSON structures directly to the Controller, which would inform the Directive's @attr template. So maybe the problem goes away in this regard, and the build could handle AMD/CommonJS wrappers which is outside of the version control layer to an extent — or at least wrappers do not necessarily have to be.

    require([
        "blah",
        "blorp",
    ], function () {
I added ``blorp`` — I never removed ``blah`` except for some limitation of the language I'm using. Why should that be part of the organic record?




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: