TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ignore the haters, and other lessons learned from creating JSON5

233 pointsby aseemkalmost 3 years ago

34 comments

furyofantaresalmost 3 years ago
Non-constructive criticism is extremely easy to produce and can make the author of it feel smart for a second. Doing it in a place where folks share their creative works is like shooting fish in a barrel.<p>There may be a tiny bit of signal in such comments but it&#x27;s mostly just noise. I try to just ignore any comment that looks like the commenter just wrote whatever came to their mind, they&#x27;re gonna forget about it in 10 seconds too when they&#x27;re off to the next thing to react to.
评论 #32380245 未加载
评论 #32383262 未加载
wildwildtestalmost 3 years ago
I think the real lesson is that popularity is a poor way of understanding whether something is actually useful or good, it can indicate those qualities but meaningless without also applying our reasoning faculties too. The author appears to remain oblivious to any of the very good reasons why people don’t like alternative json formats and incapable of incorporating that into their understanding of people’s reaction. Citing market mechanics as a justification of “popularity = value” is blowing past the many examples of where free markets produce terrible approximations of value.<p>Also, I think it’s very poor character to say on one hand that people’s reaction doesn’t bother them and dedicate a third to a half of the article to Mitchell’s criticism specifically. I think Mitchell’s criticism is completely reasonable (I remember this as an era of “solving json” through multiple alternative formats) and drawing attention to what seems in retrospect as a mean-spirited act is actually quite a cynical attempt to strip the context of it and deliberately cast Mitchell in a poor light. Mitchell’s intention is very clearly a technically minded one to nudge people away from trying to massage long term, durable standards in often trivial, subjective ways with an end goal that can only result in format thrashing that doesn’t ever address anything substantial.
评论 #32380883 未加载
11235813213455almost 3 years ago
The only 2 things I&#x27;d like to add in JSON are trailing commas and comments, and this is already supported in most JSON configs (.eslintrc, .babelrc, ..), it&#x27;s called JSONC I believe
评论 #32380998 未加载
评论 #32387153 未加载
评论 #32382490 未加载
评论 #32380898 未加载
评论 #32384967 未加载
bawolffalmost 3 years ago
I think the only valid objection here is that calling it json5 implies that it is an offical new version of json by the same people who brought you json. That&#x27;s misleading and bordering on unethical in my opinion.<p>Everything else is a matter of taste, and who really cares.
评论 #32381302 未加载
pjbkalmost 3 years ago
Whenever I need to use JSON in my projects I always check if I can use JSON5 instead. It really makes a difference to have a more user friendly format. My only gripe is when I use Python, the official JSON5 module is much, much slower than Python&#x27;s JSON parser. I frequently end up translating the development JSON5 files to JSON files that go into the final runtime because of this.
评论 #32381377 未加载
评论 #32380988 未加载
codedokodealmost 3 years ago
Honestly I don&#x27;t understand why JSON should be human-readable. It is a data serialization format intended to be read by software.<p>Just adding comments and multi-line strings doesn&#x27;t make it human-readable, it is still too bloated and I don&#x27;t like writing it manually. If you want a human-readable format, try at least to remove unnecessary quotes, brackets and commas and make it look similar to YAML.<p>JSON is not intended to be used in configs and other user-editable files.
评论 #32380171 未加载
评论 #32380187 未加载
评论 #32380145 未加载
评论 #32380047 未加载
评论 #32380008 未加载
评论 #32380447 未加载
评论 #32380557 未加载
评论 #32380311 未加载
评论 #32392128 未加载
gervwykalmost 3 years ago
I enjoy using json5. I solves a real problem imo..<p>Regarding the criticism, I get the same bad energy when people get a kick out of fixing someone’s grammar, and then do not even comprehend what is being complicated.<p>Well done on the lib and thanks for building something useful! Good writeup also! Think I’m going to give the commit access trick a shot.
评论 #32380926 未加载
sacrosanctyalmost 3 years ago
Perhaps the fact that it&#x27;s popular is exactly what those nay-sayers were worried about. They didn&#x27;t want a more fragmented world of incompatible standards.
评论 #32381268 未加载
livinginfearalmost 3 years ago
I don&#x27;t think <i>ignore the haters</i> is sage advice in this context. What was directed at this project in the original HN thread was not <i>hate</i>, it was <i>criticism</i>. These are very different things. People were not abusing the author. Some of the original commenters had very salient critiques, and questions.<p><i>&quot;Ignore the haters&quot;</i> reads like: <i>&quot;I ignored all criticism of my idea, and some other people like it anyway.&quot;</i>.<p>There&#x27;s already so many terrible technologies in the web programming domain that have plowed onwards in the face of so much criticism, and now we&#x27;re stuck with them. Part of being a good programmer is being humble, and accepting that you might not have all the answers, the best ideas, or see the bigger picture.
评论 #32381881 未加载
secondcomingalmost 3 years ago
Does ‘downloads per day’ actually mean anything? It could be someone large company’s CI system building on every commit. I don’t think I’ve ever seen a JSON5 file in the wild.<p>I’ve always wanted comments in JSON, but the other issues highlighted are not things I care about. The ‘be lenient in what you accept’ philosophy is a disaster, just look at HTTP… stricter is better IMO.
评论 #32379931 未加载
评论 #32379958 未加载
评论 #32380354 未加载
评论 #32380048 未加载
评论 #32381231 未加载
评论 #32379926 未加载
ryschengalmost 3 years ago
On the other side of this, it&#x27;s fascinating how often people fall susceptible to arguing why something should or shouldn&#x27;t exist for someone else, rather than just making a limited statement about utility for themselves. Something to stay cognizant of, this article is a good lesson on empathy!
评论 #32391627 未加载
TrianguloYalmost 3 years ago
Json comments is something I always wanted, for json files with data that you need. I even use regexp to remove them in some cases (where I know it won&#x27;t conflict with the strings themselves).<p>Didn&#x27;t knew about this json5 thing but I&#x27;ll try to use it instead.
评论 #32380184 未加载
yawnxyzalmost 3 years ago
I love JSON5! My only gripe with it is that I have no idea what the &quot;5&quot; means, and I don&#x27;t think it&#x27;s documented &#x2F; alluded to anywhere...
评论 #32380638 未加载
renewiltordalmost 3 years ago
Phew, when I read these posts, I often wonder if I said something dumb in the past and I think I can easily be proud of my comments there, though I missed the JSON5 thing[0]. Fortunately, the thing that keeps me from saying dumb shit about other peoples&#x27; tech is:<p>* my belief that people who execute on some project are inherently superior - they made a thing to solve a problem! Automatically superior to people who didn&#x27;t make a thing<p>* the Blub Paradox <a href="http:&#x2F;&#x2F;paulgraham.com&#x2F;avg.html" rel="nofollow">http:&#x2F;&#x2F;paulgraham.com&#x2F;avg.html</a> I can only judge projects accurately where I am operating at a higher-level of thought. If I don&#x27;t get the need, then I am probably not operating at a higher-level than the author. I prefer to be able to have sufficient Theory of Mind thinking that I can inhabit the author&#x27;s mind to see why they need something, make the best case for it, and then reject&#x2F;accept it if I have to. There are many places where I can&#x27;t. The most trivial example which everyone grasped before I got there is GraphQL as an API specification and IDL, which I only recently really grokked.<p>In any case, I had a figment of the idea that you talk about which is the &quot;people who won&#x27;t be your users&quot;. Thanks for citing the thought around that.<p>Congrats and good luck!<p>0: <a href="https:&#x2F;&#x2F;hn.algolia.com&#x2F;?dateRange=all&amp;page=0&amp;prefix=true&amp;query=json5%20renewilt&amp;sort=byPopularity&amp;type=comment" rel="nofollow">https:&#x2F;&#x2F;hn.algolia.com&#x2F;?dateRange=all&amp;page=0&amp;prefix=true&amp;que...</a>
stavrosalmost 3 years ago
Regardless of JSON5, I realized it&#x27;s just not constructive to tell someone why something they made will fail. It would be great if you could tell them how to <i>prevent</i> failure, but just portenting it serves nothing.
beej71almost 3 years ago
I&#x27;ll take any feedback. If someone tells me I&#x27;m dumb and have it wrong, I thank them and fix it. Now they can&#x27;t complain about it, I learned something, and someone spent their time giving me free advice.<p>But if they don&#x27;t convince me I&#x27;m wrong, then I ignore them. :)
评论 #32383385 未加载
didgetmasteralmost 3 years ago
I can really relate to this. I posted something earlier this year about how a number of file system problems are directly related to an archaic architecture that was designed when hard drive capacities were measure in MBs. I offered a possible solution in a hobby project that I have been working on for years.<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=30449263" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=30449263</a><p>While there were some really good comments, the vast majority were very negative and critical. (BTW: the comments on HN were much more civil than on Slashdot where the story also got picked up) Still, I didn&#x27;t ignore the criticism but tried to learn from it and there were some encouraging comments mixed in as well.
评论 #32380621 未加载
评论 #32381573 未加载
nojvekalmost 3 years ago
JSON5 isn’t a crazy language. Just used some productions from ECMAScript spec that is already part of JS. Anyone familiar with JS should pick up JSON5 quite easily.<p>I believe VSCode uses json5 with .json extension for a whole bunch of their configs.<p>It would be a slower parser than JSON though.
justinlloydalmost 3 years ago
In videogames, &quot;If there are enemies ahead of you, then you are going the right now.&quot;<p>I have long held the belief that if the audience of Reddit or Twitter or Slashdot or Hackernews universally hates something with such vehemance that you doubt your own thoughts then you are probably doing the right thing.<p>In the words of Casey Neistat, in his video &quot;Do what you can&#x27;t.&quot; - &quot;To the haters, the doubters, my 7th grade vice principal, to everyoneone who has ever anyone with a dream they can&#x27;t...&quot;
评论 #32381070 未加载
Dylan16807almost 3 years ago
&quot;Horrible. There&#x27;s a reason JSON is homoiconic with valid javascript.&quot; is a weird comment to read about something that takes JSON <i>closer</i> to javascript.
stickfigurealmost 3 years ago
Looks great! Please add an unambiguous timestamp type :-)
评论 #32380953 未加载
jaimex2almost 3 years ago
This is the first I&#x27;ve heard of JSON5. I can&#x27;t say my reaction is any different today.<p>Keep it simple.
smrtinsertalmost 3 years ago
I remember the original thread and agreeing about the comments addition. I still think it&#x27;s a poor addition. That said the meanness is disappointing. Congrats to the author for persevering.
keithalewisalmost 3 years ago
Glad to see basic common sense winning out. Crockford was too strident about defending his spec. These are minimal changes that sensible developers find useful in their daily work.
hsbauauvhabzbalmost 3 years ago
I integrated json5 into a project I regularly use. JSON5 saved a <i>significant</i> amount of ongoing debugging. I appreciate the efforts that went into the project. Thank you.
wdbalmost 3 years ago
I really like json5’s comments support, especially when json is used for configuration files so you can explain specific confit without needing to do it in a separate file
Barrin92almost 3 years ago
I don&#x27;t think writing an article about hackernews comments from two years ago is exactly what I&#x27;d call a lesson in ignoring the haters, but this reads a little bit like someone writing an article about the roaring success of null references after their adoption.<p>despite popularity, most of the technical comments in that original thread aren&#x27;t wrong. &#x27;Popular&#x27;, &#x27;Easy to adopt&#x27; and &#x27;a <i>very</i> bad idea&#x27; can be overlapping circles, in particular in the world of javascript and npm
评论 #32380011 未加载
评论 #32380281 未加载
评论 #32379989 未加载
评论 #32380386 未加载
评论 #32380296 未加载
dejawualmost 3 years ago
I&#x27;m kind of appalled that the Hashicorp guy went that far to put someone down for just building something they found useful to themselves. What a great way to discourage someone from expressing themselves creatively. Glad Aseem carried on regardless.
评论 #32380944 未加载
评论 #32380096 未加载
评论 #32380211 未加载
评论 #32380816 未加载
评论 #32379997 未加载
评论 #32380350 未加载
fefe23almost 3 years ago
Let me give you a data point from a neutral perspective (I have never heard of you or JSON5).<p>These were not haters. They in fact went our of their way to give arguments supporting their verdict, and in some cases even constructive suggestions like &quot;make that a preprocessor instead&quot;.<p>Your piece does not make you look like the smartest guy in the room, vindicated by success and adoring fans. It makes you look like someone who confuses internet fame points with something that actually means something. Like a sore loser who needed to convince themselves that they really are the smartest person in the room.<p>The internet is a trap. No matter how bad your idea is, you will always find people who think it&#x27;s great.<p>Just look how many people Alex Jones found who agreed with his Sandy Hook ideas.<p>Don&#x27;t go looking for fans. Go looking for people who disagree, as they will help you improve your skills and grow as a person.<p>If you were actually as good as you apparently think you are, you wouldn&#x27;t be wasting time writing text like this. You wouldn&#x27;t need to. Your work would speak for itself. I don&#x27;t remember Mozart or Einstein lament about their haters.
评论 #32380582 未加载
评论 #32385335 未加载
评论 #32380513 未加载
hnusersarelamealmost 3 years ago
The kind of people who leave criticism on HN are not worth listening to anyway. Most of the users of this site have no taste and think they&#x27;re more brilliant &#x2F; important than they actually are.
评论 #32379835 未加载
评论 #32380032 未加载
评论 #32380901 未加载
评论 #32380155 未加载
评论 #32380024 未加载
评论 #32379909 未加载
评论 #32380057 未加载
评论 #32380238 未加载
AndriyKunitsynalmost 3 years ago
I&#x27;m really puzzled by &quot;JSON is for machines, not for humans&quot; types of comments here. FFS, JSON has whitespaces, that alone should answer who it was made for. And making human-readable formats more human-readable is a good thing. JSON5 is awesome.<p>If the performance of your module suffers from parsing its inputs, you are doing some Really Terrible Thing with your inputs. And if the nature of the task really requires you to parse data quickly and on a big scale, it would be better to ditch JSON altogether and switch to a binary format like protobuf instead.
评论 #32380823 未加载
jimrandomhalmost 3 years ago
Here&#x27;s the old (2012) HN thread with the haters in it: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=4031699" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=4031699</a> . Happy to see an old (positive) comment of my own that I had forgotten about, which I think sums the whole thing up quite well. It still applies, so I&#x27;ll repost it here:<p>You know that something has gone very deeply wrong somewhere when people oppose your project because they are ideologically opposed to comments. In my own experience, finding out that many JSON parsers reject comments was a real WTF moment, and a deal breaker for my config-file application, so I ended up using JSON-plus-comments for it instead of JSON. At the same time, lack of support for trailing commas and unquoted member names have been a minor but persistent thorn in my side for no good reason. The justification for not having comments in JSON is that in the great disaster that was XML, some projects would parse the comments and take them as semantically significant. However, the real problem there was that parser libraries would expose the comments, and that some generators would put important information only in comments. But I think that these mistakes are unlikely to be repeated, and that the proposed alternative - moving all comments into the markup, or eliminating them entirely - is just obviously worse.<p>One of the things that ruined the XML ecosystem was a persistent belief that XML was to be read and written by machines, combined with a reality in which it was mostly used for human-written config files, leading to a tolerance for awful syntax (like prefixing every single attribute with a namespace, and the ridiculous CDATA notation). I&#x27;m seeing the same thing with JSON: A significant fraction of its use is for human-written and human-read config files (which often desperately need comments) and people are pretending it&#x27;s strictly a data interchange format that shouldn&#x27;t be used for that.<p>It is sometimes said that JSON was discovered, rather than invented - that the syntax was already out there. So it is with JSON5: There is nothing new in this, it is simply return to JavaScript Object Notation and bringing in the rest of what Javascript has.<p>So, all you pooh-poohing ideologists: please seriously rethink whether disallowing comments, trailing commas, and quoteless member names is actually a good idea. Consider this in light of the fact that JSON is widely used, today, as a config-file language, and that {&quot;--&quot;:&quot;This is a comment&quot;} is ridiculous enough that no one does it in practice, can&#x27;t be inserted on any line, and invites consumers of your data to parse the comments.
评论 #32380366 未加载
评论 #32380355 未加载
throwaway0x7E6almost 3 years ago
the general attitude of the critics is correct. the name you chose has implications that are not true - JSON5 has nothing to do with JSON and you have nothing to do with the people who came up with JSON. have you named it something else, you&#x27;d receive far less (if any) negative comments.
评论 #32380299 未加载
thrown_22almost 3 years ago
I still don&#x27;t get what the point of json is. If you want to dump raw JS data structures as text just do. You don&#x27;t need a spec or special tools. If you want human readable XML just use s-expressions. Something that&#x27;s so easy to parse you can roll your own in an afternoon.<p>Json is trying to square the circle of &quot;I want things to be easy&quot; but also &quot;I want to not shoot myself in the foot&quot;, goals which are mutually exclusive. Every new version of json is just gods way of teaching people how XML got to be the mess it is.
评论 #32380639 未加载
评论 #32380233 未加载
评论 #32380658 未加载
评论 #32380651 未加载