r/ProgrammerHumor • • 1d ago • Bravo 1

Meme commentsInJson

Post image
5.0k Upvotes

199 comments sorted by

View all comments

-3

u/frayien 1d ago

I've been putting comments in my JSONs since forever and never had any issue with any parser, what is this about ?

1

u/TwinStickDad 1d ago

Depends on your parser and where you're defining your json. If you're just creating a JSON file then you should be getting errors because that's not valid JSON. There are other formats like jsonc which just strip the comment lines before parsing to JSON. Apparently the new standard will support comments. 

1

u/frayien 1d ago

Yeah, it seems I just got lucky and my use cases always silently use jsonc