4 ms·
> - Lack of comments: not an issue with JSON5. Yeah, but now you have to find a tool that supports that. Easy on small projects, but try being at a company sup
by echelon 8y ago
> - Lack of comments: not an issue with JSON5.
Yeah, but now you have to find a tool that supports that. Easy on small projects, but try being at a company supporting many languages and frameworks.
> - Readability: I think it's pretty readable. Are the quotes, semicolons and commas really an issue? Not for me.
If you haven't tried TOML, you're missing out. Why on earth would you put up with syntax (hard to author, at that) that isn't necessary? Syntax distracts from the actual problem that this is trying to solve. JSON is fine for machine read/write, but horrible on humans.
> - Strictness: just edit it with an editor that points at the errors quickly. Escaping quotes might be annoying, but I can't think of a possible alternative format where escaping isn't required at all.
What if you have an issue in prod and need to fix something quick? You might only be able to open it up in a stripped-down vi, or if the machine is locked down you might only be able to materialize a plain text view. What if not everyone uses the same tool? This imposes a further constraint. Yet more concessions pointing to how horrible JSON is for humans.
> - Lack of programmability: I've never had any problem with this, and again pretty complex and customizable applications like VS Code seem to be doing fine without this.
Can you imagine projects where this might be an issue? These aren't the only codebases in the world. And just because VSCode appears to be doing fine doesn't mean they don't second guess that decision. They might just be locked in at this point.
- ohaideredevs 8y agoGenerally, you swap out the config file at build time if that's a requirement. Just as a few examples - you can set up a dev/demo/prod(whatever you call these where you work) config file in .NET Core, Docker/K8S, Angular, etc. As far as I know, this is considered best practice.
- echelon 8y agoThere are many different needs. - static config - environment specification - runtime feature flagging - semi-static control plane config - rollout weights Etc. All of these have different characteristics. Infrequently changed, a priori config that doesn't need to be changed in emergencies is suitable for baking in at compile time.
- reissbaker 8y agoMost languages have JSON5 libraries just as they have TOML libs. TOML is decent but if you need nested data it gets super awkward. > What if you have an issue in prod and need to fix something quick? You might only be able to open it up in a stripped-down vi, or if the machine is locked down you might only be able to materialize a plain text view. What if not everyone uses the same tool? This imposes a further constraint. Yet more concessions pointing to how horrible JSON is for humans. JSON5 is pretty easy to edit correctly with any text editor. Not much harder than TOML. > Can you imagine projects where [lack of programmability] might be an issue? These aren't the only codebases in the world. And just because VSCode appears to be doing fine doesn't mean they don't second guess that decision. They might just be locked in at this point. Does TOML allow programmability that JSON5 doesn't?
- pmoleri 8y agoThis is the first time I read about TOM. After checking out the syntax, I don't like the way you declare nested data, because if you need to move one block of data to a different parent you need to replace all the path of each table. If done wrong, this can lead to very difficult to find errors. OTOH, it can be easier to send partial information, just append this block to your config and you are done.
- h1d 8y agoHow do you tell if a file is json or json5? Feels better to forget about json for config and go with the obvious TOML that has single file extension with single standard.
- DonHopkins 8y agoWhile J4X would simply let you specify the version number in the DTD, if course! ;) https://news.ycombinator.com/item?id=19656646 https://news.ycombinator.com/item?id=19656646
- int_19h 8y agoIf you're trying to parse it, you don't need to tell. Just parse as JSON5, it's a strict superset. And if you're editing a file, you can usually tell by the fact that there are comments in it. :)
- monkpit 8y ago> What if you have an issue in prod and need to fix something quick? Just fix it quick somewhere that’s not prod. Snowflaking has not been a good practice for a long time now, so arguing that a certain tool makes it easier is a bit of a moot point.