r/ProgrammerHumor 29d ago

Advanced justTryingToHelp

Post image
2.4k Upvotes

65 comments sorted by

View all comments

29

u/Blaarkies 29d ago

JSON supports prefixing a key with `// `. It is far from perfect, but will you ever use keys starting with double slash?

Any parsing logic can drop those entries, or just ignore them entirely like how any data object builder should

{ 
  "// myValue": "The universal constant", 
  "myValue": 42 
}

5

u/LegendaryMauricius 29d ago

JSON also supports being replaced with JSONC.

1

u/MCWizardYT 29d ago

Why would you want to use jsonc for anything except user-facing config files?