News for hackers. Stuff that matters.
Re:Ignore the haters, and other lessons learned from creatin... by furyofantares on Sunday August 07, 2022 @05:42PM (#32380195)
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.

There may be a tiny bit of signal in such comments but it's mostly just noise. I try to just ignore any comment that looks like the commenter just wrote whatever came to their mind, they're gonna forget about it in 10 seconds too when they're off to the next thing to react to.

Re:Ignore the haters, and other lessons learned from creatin... by vlunkr on Sunday August 07, 2022 @05:49PM (#32380245)
Many of those original comments were pretty spot on though. Maybe the constructive criticism you need sometimes is “don’t do this”

JSON is useful partially because it’s easy to parse, so parsers already exist in every language. Extending the syntax is undoing all the communal work, and encroaching on grounds that YAML and other languages already cover.

Re:Ignore the haters, and other lessons learned from creatin... by bobthepanda on Sunday August 07, 2022 @06:22PM (#32380520)
This seems like making a mountain out of a molehill.

> Extending the syntax is undoing all the communal work

JSON5 takes stuff from ES5.1 and adds it to JSON, and ES5 is backwards-compatible with older JS. This means it's fairly trivial to convert JSON5 to JSON (literally 13 lines: https://gist.github.com/iddan/3d34b12f6b22c30a8a07c149b3175e...). And ES5.1 itself was the product of communal work.

> encroaching on grounds that YAML and other languages already cover.

I don't know that we should really start dividing features into nice little boxes so no one steps on each other's toes. Trying different solutions for the same problem can eventually bring us more optimal solutions than if we just sat around twiddling our thumbs because 'it's been done'. It's not like there's an army knocking on your door going "switch to JSON5 or we'll kick your teeth in." People can stick with what they want to do on the merits, but I don't see that as a reason to shut down others' work.

Re:Ignore the haters, and other lessons learned from creatin... by arinlen on Sunday August 07, 2022 @07:22PM (#32380890)
> JSON5 takes stuff from ES5.1 and adds it to JSON, and ES5 is backwards-compatible with older JS. This means it's fairly trivial to convert JSON5 to JSON (literally 13 lines).

This take is disingenuous and horribly uninformed and very shortsighted.

Not every parser out there is JavaScript eval(). Some people actually had to write and maintain a parser in whatever programming language they have to work with.

In the past I wrote a JSON parser for a low-level language, and back then I had to write the letter and parser by hand. Each change to accepted JSON values meant I had to add at least one terminal token, update the grammar to include it, and update the data model to support yet another type.

Adding comments would either require adding a terminal token to be ignored, or rewrite the data model to support positional items that cursors/iterators could or could not skip.

These are not 13LoC changes. At all.

And if I happen to be consuming an API I don't control which for God knows what reason decided to move to json5, I would either have to rush a parser to production or remain down.

Re:Ignore the haters, and other lessons learned from creatin... by dietrichepp on Sunday August 07, 2022 @10:12PM (#32381812)
Saying the take is “disingenuous” is certainly a rude and inappropriate response.

You can disagree with someone without accusing them of being insincere or arguing in bad faith (which is what “disingenuous” means).

Re:Ignore the haters, and other lessons learned from creatin... by acedTrex on Monday August 08, 2022 @08:47AM (#32384801)
It is disingenuous to reply to a comment about "undoing all the json parser work across multiple languages" with "no it hasn't it's just 13 lines in javascript see!"
Re:Ignore the haters, and other lessons learned from creatin... by claytongulick on Monday August 08, 2022 @09:05AM (#32384922)
It is potentially uninformed, possibly mistaken, but not disingenuous.

We're supposed to assume best intent.

Accusing someone of being "disingenuous", "horribly uninformed" and "short sighted" for providing an different opinion isn't doing that.

I learned something from the post. I learned that these enhancements are already mostly being codified in the language.

That influenced my opinion on the subject.

I assumed that the 13 lines of code comment was in the context of js, not (for example) a c parser, where it's pretty normal for 13 lines of js to translate to hundreds or potentially thousands of lines of C code.

The post was informative and respectful.

The name-calling response was not.

Re:Ignore the haters, and other lessons learned from creatin... by arinlen on Tuesday August 09, 2022 @01:26PM (#32400937)
> We're supposed to assume best intent.

No one with the faintest understanding of what a parser is and does would ever claim that any of these changes could ever take 13loc to implement.

If they are ignorant and still feel compelled to pass false claims on how significant changes are instead trivial just to try to downplay the real world challenges, they are undoubtedly being disingenuous.

Re:Ignore the haters, and other lessons learned from creatin... by xpe on Thursday August 11, 2022 @08:17AM (#32424563)
The commenters above (who I agree with) are suggesting the following, I think:

Rather than write this:

> This take is disingenuous and horribly uninformed and very shortsighted.

Write this instead: "This take is horribly uninformed and very shortsighted."

Think of this way: we're asking if you can find ways to not assume bad faith in another party.

> If they are ignorant and still feel compelled to pass false claims on how significant changes are instead trivial just to try to downplay the real world challenges, they are undoubtedly being disingenuous.

From the Apple dictionary:

>> disingenuous: not candid or sincere, typically by pretending that one knows less about something than one really does: he was being somewhat disingenuous as well as cynical.

Re:Ignore the haters, and other lessons learned from creatin... by Brian_K_White on Monday August 08, 2022 @09:25AM (#32385083)
So it's at best disingenuos or ignorant, merely not necessarily both.
Re:Ignore the haters, and other lessons learned from creatin... by RobertWHurst on Thursday August 11, 2022 @12:40PM (#32428346)
Comments is clearly for configs, not for server responses, but even if someone did respond with json5, as the previous post said, you don't have to tokenize the json5, you can convert it to json first (since I would imagine you don't need comments). I can imagine how you feel about graphql.
Re:Ignore the haters, and other lessons learned from creatin... by h0l0cube on Sunday August 07, 2022 @07:38PM (#32380992)
I agree with your point here (but I'm not the GP). The main thrust of the article is about finding product/market fit, and it could be said here that the market isn't the parser writers, who would be disrupted, but the developers who want a JSON format with better ergonomics.

> And if I happen to be consuming an API I don't control which for God knows what reason decided to move to json5

And such a decision might be the API maintainers not understanding their users.

Re:Ignore the haters, and other lessons learned from creatin... by Brian_K_White on Monday August 08, 2022 @09:40AM (#32385229)
It's no longer better ergonomics if you can't use it at all because half your endpoints don't support it, and the reason they don't support it is not mere neutral time or popularity but a result of the fact that the new form no longer posesses the qualities that made the original form useful.

This really does look like a case of missing a point and proceeding with a bad idea that results in an all around increase in harm, because no matter the idea, there will always be at least a few adopters and then everyone else has to deal with it.

If it's allowed for anyone to come up with any new idea they want, then it has to be equally allowed for others to criticize. Anything else is literally not sane.

It's perfectly likely the "haters" are right and the idea is bad and should not be adopted or proliferate. It's also possible they are merely unthinking haters.

But calling them "haters" is not a valid defense of the idea.

Re:Ignore the haters, and other lessons learned from creatin... by h0l0cube on Tuesday August 09, 2022 @12:31AM (#32394167)
> If it's allowed for anyone to come up with any new idea they want, then it has to be equally allowed for others to criticize.

Never disputed this.

> It's no longer better ergonomics if you can't use it at all because half your endpoints don't support it

Incompatibility != lack of ergonomics. People use new and incompatible frameworks all the time. It could be argued that JSON had better ergonomics at a time when XML was more popular, in spite of impedance mismatch with other APIs. Similar could be said of what's happening with python 3 vs python 2 the last decade. How do standards improve without breaking anything?

> But calling them "haters" is not a valid defense of the idea.

From reading the article, it seems like people were particularly cruel, well beyond constructive criticism into straight up ridicule:

> But he went even further: Mitchell took the time to make a parody project of JSON5 [..] even making fun of me by name.

OP was gracious about it however:

> I reached out to Mitchell as part of writing this post [..] I assumed he regretted it in retrospect, and I harbored no grudge or ill will towards him.

> Mitchell confirmed this assumption to be true and offered a genuine, sincere apology. Thank you, Mitchell — I appreciated that a lot.

He doesn't appear to take personal affront, so I think his use of the term 'haters' is playful, but I think also fair when you consider that even those mocking them felt bad about their conduct.

Re:Ignore the haters, and other lessons learned from creatin... by shellfisher on Tuesday August 09, 2022 @04:54PM (#32404155)
If you happened to use an API that switched to XML or whatever other thing you’d be in the same boat. What a ridiculous argument.
Re:Ignore the haters, and other lessons learned from creatin... by jhardy54 on Sunday August 07, 2022 @07:15PM (#32380851)
> This means it's fairly trivial to convert JSON5 to JSON (literally 13 lines: https://gist.github.com/iddan/3d34b12f6b22c30a8a07c149b3175e...).

Did you paste the correct link? This just plumbs together an existing JSON 5 parser with a JSON 4 serializer.

How many lines does this take without importing a library the solves this for you?

Re:Ignore the haters, and other lessons learned from creatin... by bobthepanda on Sunday August 07, 2022 @07:34PM (#32380967)
JSON5 parse constructs a Javascript object, which can in turn be serialized by JSON 4 into valid plain JSON string. That's not an invalid way of converting the two objects.

JSON.stringify is part of the standard JS spec: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

JSON5.parse() is part of JSON5's API: https://json5.org/#json5parse

So any project that includes both standard JS and JSON5 could literally copy and paste this code. You're still importing JSON5, but you would presumably have to do that anyways to use JSON5.

Re:Ignore the haters, and other lessons learned from creatin... by MauranKilom on Sunday August 07, 2022 @07:42PM (#32381016)
> So any project that includes both standard JS and JSON5 could literally copy and paste this code

is not a convincing reply to

> so parsers already exist in every language

Re:Ignore the haters, and other lessons learned from creatin... by Falkon1313 on Sunday August 07, 2022 @09:18PM (#32381541)
Personally, I like some of the ideas of JSON5, but it isn't compatible with JSON as implemented. Altering existing systems to use it isn't as trivial as you imply. And requires taking on new dependencies.

You'd have to rewrite anything using json_encode() and json_decode() in PHP, or the equivalent standard functions/methods in Python, C#, etc. And also take on another dependency. And maybe lose performance.

And then you sometimes may have to know whether you're dealing with JSON or JSON5, and what the program on the other end of the line produces or expects and can handle.

For new greenfield projects it might be worthwhile. But most of the world runs on legacy code and many prefer to stick to the standards and minimize dependencies. So it's not that simple.

That doesn't mean it's bad though. Like anything else in software, it's a trade-off.

Re:Ignore the haters, and other lessons learned from creatin... by jhardy54 on Monday August 08, 2022 @12:00AM (#32382290)
What about the vast majority of languages that aren’t JavaScript?
Re:Ignore the haters, and other lessons learned from creatin... by leaflets2 on Monday August 08, 2022 @03:55AM (#32383262)
> can make the author of it feel smart for a second

Since this behavior is so common, apparently it works, evolutionary:

It makes others think your are smart, for a long while

And not much effort required, on your part. So, a great opportunity?

And the more popular the project you start bashing is, the smarter you'll seem? Corollary: If one builds something great, one will get dissed by some.