this post was submitted on 24 Feb 2026
521 points (97.8% liked)

Programmer Humor

30063 readers
1689 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] artifex@piefed.social 178 points 3 days ago (19 children)
[–] Fmstrat@lemmy.world 2 points 1 day ago

I love JSON. But I really wish there was a standard that allowed commas with no following items and that there was a syntax for comments.

[–] Valmond@lemmy.dbzer0.com 67 points 3 days ago (6 children)

Chuck in comments and I'm on board.

[–] panda_abyss@lemmy.ca 78 points 3 days ago (4 children)

If we’re adding comments to json, can we add canonical support for trailing commas?

load more comments (4 replies)
[–] luciferofastora@feddit.org 20 points 3 days ago (5 children)

They were chucked out because, according to the guy who defined it, people started using them for parsing directives, which hurt interoperability because now you needed to be sure that the parser would both read the comments and interpret them correctly. Suddenly, those comments might make otherwise identical files parse differently. If the whole point is that it's reliable and machine-readable, keeping it to the minimal set of features and not extending it any way whatsoever is a good way to ensure compatibility.

What you can do is define some property for comments. It's not standardised, but you could do stuff like

{
  "//": "This is a common marker for comments",
  "#": "I've never seen that as a property name, so it might be safe?",
  "_comment": "Property names with underscore for technical fields seem common enough as well, and it's semantically explicit about its purpose"
}
[–] The_Decryptor@aussie.zone 8 points 2 days ago (2 children)

And also, JSON was intended as a data serialisation format, and it's not like computers actually get value from the comments, they're just wasted space.

People went on to use JSON for human readable configuration files, and instantly wanted to add comments, rather than reconsider their choice because the truth is that JSON isn't a good configuration format.

[–] BorgDrone@feddit.nl 7 points 2 days ago

JSON was intended as a data serialisation format

Why then use a inefficient text based format instead of a much more efficient and easy to parse binary format?

Just use DER encoded ASN.1 like a normal person.

load more comments (1 replies)
load more comments (4 replies)
load more comments (4 replies)
[–] marcos@lemmy.world 38 points 3 days ago

Well...

It's name-value pairs, with groups denoted by balanced brackets. It's close to as good as you can get for one kind of data serialization.

What is impressive is how many problems people manage to fit in something so small.

[–] SlurpingPus@lemmy.world 28 points 3 days ago (2 children)

What's it called when people try to reinvent Lisp for the hundredth time?

load more comments (15 replies)
[–] palordrolap@fedia.io 140 points 3 days ago (8 children)
orange = {
    you = "glad",
    I = {
        didn\'t = {
            say = "banana"
        }
    }
}
load more comments (8 replies)
[–] qevlarr@lemmy.world 76 points 3 days ago (6 children)
[–] LiveLM@lemmy.zip 33 points 3 days ago (10 children)

The json spec is not versioned. There were two changes to it in 2005 (the removal of comments

See, this is why we can't have nice things.

load more comments (10 replies)
load more comments (5 replies)
[–] panda_abyss@lemmy.ca 86 points 3 days ago (14 children)

If yaml didn’t have anchors and 8 different white space formats, it’d be a great replacement for this kind of thing.

But yaml is a mess, and you’d think you could parse it easily, but you can’t.

[–] floquant@lemmy.dbzer0.com 53 points 3 days ago (4 children)

YAML is redeemed by one thing only:

All JSON is valid YAML.

load more comments (4 replies)
[–] Flamekebab@piefed.social 27 points 3 days ago (3 children)

As someone who works with YAML regularly:

Fuck YAML.

load more comments (3 replies)
load more comments (12 replies)
[–] Klear@quokk.au 21 points 3 days ago (2 children)

As someone who likes lua, I don't see the problem.

[–] Sv443@sh.itjust.works 3 points 1 day ago

Never talk to my daughter again

[–] _stranger_@lemmy.world 12 points 2 days ago

The very minor and nitpicky problem is that if you want JSON just use JSON. there's still a place in the world for human readable/ editable configs that don't require linters to be run on them after. (Current TOML is fine, I like it).

[–] Michal@programming.dev 41 points 3 days ago (5 children)

I like this. I also like yaml, I've had very few issues with it and it's nicer to work with than json.

Json's lack of support for trailing commas and comments makes it very annoying for everyday use.

[–] Senal@programming.dev 50 points 3 days ago (9 children)

Significant white-space is bullshit and i will die on this hill.

[–] BlueKey@fedia.io 13 points 3 days ago (1 children)

Is there space left on the hill? I want to join you.

[–] Michal@programming.dev 20 points 3 days ago (3 children)

I hear there's significant space left

load more comments (3 replies)
[–] Shanmugha@lemmy.world 1 points 1 day ago

You are not alone, my friend

load more comments (7 replies)
load more comments (4 replies)

I love NixOS

[–] bitwolf@sh.itjust.works 1 points 1 day ago

TOML v1.1 just looks like HCL.

Just use HCL at that point.

[–] Brosplosion@lemmy.zip 1 points 1 day ago (2 children)

I will die on the hill that XML is a superior config format and people are just afraid of it cause they see the advanced features (that you don't need to use) and think it's too complicated.

[–] Asetru@feddit.org 2 points 1 day ago (1 children)

Then maybe you should go ahead and write a brutally messed up but somehow ubiquitous scripting language that just somehow has its object instanciations look exactly like xml so those files can be imported right into scripts that then somehow turn into full blown server applications so xml gets the same attention as Json.

[–] Brosplosion@lemmy.zip 3 points 1 day ago (1 children)

I'll call it XMLlamascript

[–] Asetru@feddit.org 1 points 1 day ago

I'm so looking forward to it.

Don't forget to add a "package management" service that at first glance makes importing XMLlamascript modules super easy but at second glance takes down the Internet after you piss off a random maintainer before then turning into a malware distribution engine.

[–] bitwolf@sh.itjust.works 1 points 1 day ago (1 children)

I'd have a much easier time with XML if I could feed it a json schema or something similar so my editor knows the format it should be in.

[–] wer2@lemmy.zip 2 points 1 day ago (1 children)
[–] bitwolf@sh.itjust.works 2 points 1 day ago

This looks exactly like what I am looking for. Thank you!

[–] AnyOldName3@lemmy.world 37 points 3 days ago (1 children)

TOML's design is based on the idea that INI was a good format. This was always going to cause problems, as INI was never good, and never a format. In reality, it was hundreds of different formats people decided to use the same file extension for, all with their own incompatible quirks and rarely any ability to identify which variant you were using and therefore which quirks would need to be worked around.

The changes in the third panel were inevitable, as people have data with nested structure that they're going to want to represent, and without significant whitespace, TOML was always going to need some kind of character to delimit nesting.

load more comments (1 replies)
[–] arcine@jlai.lu 34 points 3 days ago (7 children)

Nix is the next step in that evolution. It's basically just JSON that can generate itself !

[–] massive_bereavement@fedia.io 39 points 3 days ago (2 children)

Sounds like Nix is a pathway to many abilities I consider to be unnatural.

load more comments (2 replies)
load more comments (6 replies)
[–] Solemarc@lemmy.world 23 points 3 days ago (1 children)

If this is where the toml train ends I will be happy with it. If they do a yaml, I will be very upset.

load more comments (1 replies)
load more comments
view more: next ›