Live data from Hacker News

ECMA-404: The JSON Data Interchange Format [pdf]

ecma-international.org

71–80 of 199 posts

Re: ECMA-404: The JSON Data Interchange Format [pdf]

#71

Several comments mention the "Software shall be used for Good, not Evil" licensing issue in the JSON code from json.org. The original json.js file from json.org had this copyright and license: Copyright (c) 2005 JSON.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, includi…

You mean Douglas Crockford broke down and gave into the "pro-evil fanatics"?

For context, after Mr. Crockford gave IBM permission to use the license without the clause a few open source projects (mine included), also asked, and Mr. Crockford's response was a bit over the top-

> I released to free use for all with the only condition that it not be used for evil. If that is unacceptable to you, then you may not use it. Your options are to bend to the pro-evil fanatics, or to find a more reasonable hosting solution.

It's nice to see he's become a bit more reasonable.

Re: ECMA-404: The JSON Data Interchange Format [pdf]

#72

Several comments mention the "Software shall be used for Good, not Evil" licensing issue in the JSON code from json.org. The original json.js file from json.org had this copyright and license: Copyright (c) 2005 JSON.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, includi…

That's great news. It has been a major inconvenience to remember to use XML in all of my evil applications.

Re: ECMA-404: The JSON Data Interchange Format [pdf]

#73
post #46
post #8

My faint hopes for trailing comma support are now crushed.

What does trailing comma support get you?

It simplifies generating JSON, since you don't need a special case for the last item, and it simplifies editing it, since you don't need to do something special when adding a new item at the end. I can't see any benefit to not having it, honestly.

Re: ECMA-404: The JSON Data Interchange Format [pdf]

#74
post #55

Earlier quoted context omitted.

Doesn't seem like a good reason for a spec. Laziness is partly why Javascript as a language is so messed up.

If I could down-vote this lazy, drive-by, language bashing I would. Back up 'so messed up' or keep comments like this to yourself, they don't help the discussion.

It is a terrible language, though. That's common knowledge.

It is, however, wrong to say it's terrible because of laziness.

Re: ECMA-404: The JSON Data Interchange Format [pdf]

#75
post #40

Earlier quoted context omitted.

This sucks, because it limits the usability of JSON. It should interfere with its being a serialization and interchange format, but for configuration files anything without comments is useless.

Not really... just add a "comment" key and then ignore it when processing.

That's pretty ugly in practice.

A better solution is to use YAML for things like configuration files. It's more pleasant for a human than JSON would be even if it supported comments, and there are nice parsing libraries available for every popular language.

Re: ECMA-404: The JSON Data Interchange Format [pdf]

#76
post #40

Earlier quoted context omitted.

This sucks, because it limits the usability of JSON. It should interfere with its being a serialization and interchange format, but for configuration files anything without comments is useless.

https://plus.google.com/118095276221607585885/posts/RK8qyGVa...

That's pretty laughable. What exactly prevents people from putting parsing directives in a special object key or list entry at the beginning of the file?

Re: ECMA-404: The JSON Data Interchange Format [pdf]

#77
post #58

Earlier quoted context omitted.

I am talking about BACKslash (REVERSE solidus). This says they are the same: http://en.wikipedia.org/wiki/Backslash

Interesting. It says they're the same thing, but then the two characters listed on the page (the regular backslash and the Unicode variant) are rendered noticeably differently. I can't imagine why they changed the name, given that the forward slash and the solidus are not interchangeable. http://www.fileformat.info/info/unicode/char/5c/index.htm

Look at the HTML. The "unicode variant" is rendered differently because the code tells the browser to render it differently, not because it's a different character.

    \

Re: ECMA-404: The JSON Data Interchange Format [pdf]

#78

Earlier quoted context omitted.

Trailing commas would make the problem worse! If you allow trailing commas then you would break json parsing in all old version of IE. The unicode line ending problem is more subtle. I have seen people write code like (mix javascript and some templating): var prefs = ; ... The above code looks okay, but if the json is just spec conforming, then you are exposed to a potential XSS attack. Most people that write json en…

> you would break json parsing in all old version of IE Why do people still care about old versions of IE?

~22% of China still uses IE6: http://www.ie6countdown.com/

Developing nations have a tendency to not use the latest and greatest. If reaching them is important for you/your product then you have to keep tracking this stuff.

Re: ECMA-404: The JSON Data Interchange Format [pdf]

#79

Earlier quoted context omitted.

For large code bases, you don't break git blame by adding in new arguments. And it's one less thing to think about when editing your code: always add a comma, never worry about errors because you need to add a comma to the line above.

This is why you prepend the comma before every succeeding item in a list or map.

This seems to only move the problem to the first item instead of the last one, not solve it.

Re: ECMA-404: The JSON Data Interchange Format [pdf]

#80

Several comments mention the "Software shall be used for Good, not Evil" licensing issue in the JSON code from json.org. The original json.js file from json.org had this copyright and license: Copyright (c) 2005 JSON.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, includi…

You can feel free to use json2.js for good or evil.

The NSA breathes a sigh of relief.

Post reply on HN