PLDB
Languages Features Calendar CSV Lists Blog About Donate Add Language
GitHub icon
does-every-programming-language-support-line-comments.html · a-language-without-comments.html · hello-world-year-5.html

A Language Without Comments

by Breck Yunits

January 1, 2022 — JSON is the only popular language in the PLDB without comments.

Douglas Crockford explained his unique design decision in 2012. He had comments originally but removed them to prevent ecosystem fragmentation:

I removed comments from JSON because I saw people were using them to hold parsing directives, a practice which would have destroyed interoperability. I know that the lack of comments makes some people sad, but it shouldn't. Suppose you are using JSON to keep configuration files, which you would like to annotate. Go ahead and insert all the comments you like. Then pipe it through JSMin before handing it to your JSON parser. - Douglas Crockford - April 30, 2012 - Source

A number of JSON derivatives added comments back, such as JSON5, Hjson and JSON with Comments.

View source

PLDB - Build the next great programming language · v2023 · Day 153 · Docs · Build · Acknowledgements · Traffic Today · Traffic Trends · Mirrors · GitHub · feedback@pldb.com