为什么没有任何方法可以在JSON中发表评论 [英] Why is there no any method to comment in JSON

查看:171
本文介绍了为什么没有任何方法可以在JSON中发表评论的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在练习JSON,然后突然间,我遇到了一个只能通过注释处理的通信问题,这样我才能够将我的逻辑数据结构有效地转移给其他编程人员。我谷歌搜索如何在JSON中发表评论,但我找到的答案是你可以用JSON评论。那么为什么JSON开发人员不在JSON中添加注释方法,以便其他开发人员可以正确地感知数据呢?我将同样的问题发布到stack-overlflow,希望我能得到理想的答案。

I was practicing JSON, then suddenly, I came across a communication problem which can only be handled using comment so that I could become able to transfer my logical data structure efficiently to other my programming fellows. I google to search out how to comment in JSON, but the answer that I found was "You can comment in JSON". So why did JSON developers not add method to comment in JSON so other developer can perceive the data correctly? I posted this same question to stack-overlflow, hope I will get desired well-perceived answer.

推荐答案

评论是不是的一部分官方JSON标准。



http://json.org/ [ ^ ]
Comments are not part of the official JSON standard.

http://json.org/[^]


请查看我对该问题的评论,也不是JSON评论。 :-)

不,你可以评论不是真的:你可以很容易地找到它:

http://json.org

http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf



人们评论JSON,他们要么使用一些实际数据进行评论,要么他们实际使用常规JavaScript评论(或任何其他形式的评论)并将其称为JSON,但这不是真正的JSON。这些注释可以临时使用,在将真实JSON提供给符合此标准的算法之前将其过滤掉。换句话说,使用一些从未真正的JSON注释的技巧,这些注释不存在。



为什么会这样?请再次查看我对此问题的评论。 :-)



-SA
Please see my comment to the question, which is also not a JSON comment. :-)
No, "you can comment" is not true: you can easily find it out:
http://json.org,
http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf.

When people comment JSON, they either use some actual data for commenting, or they actually use regular JavaScript comments (or any other form of comments) and call it JSON, but this is not real JSON. Such comments could be used on temporary basis, filtering them out before feeding "real" JSON to algorithm compliant with this standard. In other word, using some tricks which are never real JSON comments, which don't exist.

Why so? Please see my comment to the question again. :-)

—SA


这篇关于为什么没有任何方法可以在JSON中发表评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆