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

Programmer Humor

30504 readers
2897 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 weeks ago (19 children)
[–] Valmond@lemmy.dbzer0.com 68 points 3 weeks ago (5 children)

Chuck in comments and I'm on board.

[–] panda_abyss@lemmy.ca 79 points 3 weeks ago (1 children)

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

[–] Valmond@lemmy.dbzer0.com 23 points 3 weeks ago (1 children)
[–] panda_abyss@lemmy.ca 33 points 3 weeks ago (1 children)

Oh, a trailing comma? That’s a tuple.

[–] Valmond@lemmy.dbzer0.com 10 points 3 weeks ago (1 children)

Yeah when the call_func((a,)) is the way to go it is a newbie pain for sure. Remember banging my head on that one.

load more comments (1 replies)
[–] Anafabula@discuss.tchncs.de 25 points 3 weeks ago (1 children)

Just make JSON5 the new official version and I would be ok

[–] Valmond@lemmy.dbzer0.com 10 points 3 weeks ago

That seems quite good, not overdoing it too.

[–] luciferofastora@feddit.org 21 points 3 weeks ago (8 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"
}
load more comments (8 replies)
load more comments (2 replies)
[–] marcos@lemmy.world 38 points 3 weeks 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 weeks ago (2 children)

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

load more comments (16 replies)
[–] palordrolap@fedia.io 141 points 3 weeks ago (1 children)
orange = {
    you = "glad",
    I = {
        didn\'t = {
            say = "banana"
        }
    }
}
[–] slightperil@lemmy.zip 16 points 3 weeks ago (7 children)

I was such a menace with this joke as a child. Haha

load more comments (7 replies)
[–] panda_abyss@lemmy.ca 87 points 3 weeks ago (9 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 weeks ago (1 children)

YAML is redeemed by one thing only:

All JSON is valid YAML.

[–] PieMePlenty@lemmy.world 11 points 3 weeks ago (1 children)

No way. You're telling me I can just write json instead?

[–] Jayjader@jlai.lu 11 points 3 weeks ago* (last edited 3 weeks ago) (2 children)

Yup! YAML is defined as a "strict superset" of JSON (or at least, it was the last time I checked).

It's a lot like markdown and HTML; when you want to write something deeply structured and somewhat complex you can always drop back/down to the format with explicit closing delimiters and it just works™.

load more comments (2 replies)
[–] Flamekebab@piefed.social 28 points 3 weeks ago (3 children)

As someone who works with YAML regularly:

Fuck YAML.

[–] Damage@feddit.it 18 points 3 weeks ago

As someone who runs Home Assistant:
Fuck YAML.

load more comments (2 replies)
[–] suicidaleggroll@lemmy.world 24 points 3 weeks ago (1 children)

I want to like yaml, I really do, but why are there so many different ways of specifying the same thing?

load more comments (1 replies)
[–] ramble81@lemmy.zip 15 points 3 weeks ago (1 children)

I have a fundamental disdain for formats with restrictive white space definitions (I’m looking too at you Python)

[–] panda_abyss@lemmy.ca 13 points 3 weeks ago (3 children)

I’ve never had this issue with Python, but makefile has given me plenty of whitespace issues.

load more comments (3 replies)
load more comments (5 replies)
[–] qevlarr@lemmy.world 77 points 3 weeks ago (6 children)
[–] LiveLM@lemmy.zip 33 points 3 weeks ago (1 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.

[–] Ephera@lemmy.ml 14 points 3 weeks ago (9 children)

I can kind of understand it after having to work with an XML file where users encoded data into comments for no good reason. But yeah, it does make JSON awkward for lots of potential use-cases.

load more comments (9 replies)
[–] tfw_no_toiletpaper@lemmy.world 11 points 3 weeks ago

As if I didn't hate the format enough before

load more comments (4 replies)
[–] Michal@programming.dev 41 points 3 weeks 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 51 points 3 weeks ago (19 children)

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

[–] BlueKey@fedia.io 14 points 3 weeks ago (1 children)

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

[–] Michal@programming.dev 21 points 3 weeks ago (3 children)

I hear there's significant space left

load more comments (3 replies)
load more comments (18 replies)
load more comments (4 replies)
[–] AnyOldName3@lemmy.world 37 points 3 weeks 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.

[–] Ephera@lemmy.ml 22 points 3 weeks ago

Well, Wikipedia does say:

The [TOML] project standardizes the implementation of the ubiquitous INI file format (which it has largely supplanted[citation needed]), removing ambiguity from its interpretation.

https://en.wikipedia.org/wiki/TOML

[–] arcine@jlai.lu 34 points 3 weeks ago (5 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 weeks ago (2 children)

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

[–] Bassman1805@lemmy.world 14 points 3 weeks ago

Yeah, it really is. A plaintext document that generates an entire OS?

load more comments (1 replies)
[–] KindaABigDyl@programming.dev 18 points 3 weeks ago* (last edited 3 weeks ago) (2 children)

It’s basically just JSON that can generate itself !

You have inspired me.

I will make JSON with meta-programming

I will call it DyJSON, i.e. "Dynamic JSON" but pronounced "Die, Jason!"

It is JSON with meta-programming and the ability to call C functions from libraries

Example:

# This is a line comment

# Put your function definitions up here
(concat str_a str_b: "concat" "my-lib.so") # Import a function through a C ABI
(make-person first_name last_name email -> { # Define our own generative func
    "name": (concat (concat $first_name " ") $last_name),
    "email": $email
})

# And then the JSON part which uses them
[
    (make-person "Jenny" "Craig" "jenn.craig.420@hotmail.com"),
    (make-person "Parson" "Brown" null)
]

As you can see, it is also a LISP to some degree

Is there a need for this? A purpose? No. But some things simply should exist

Thank you for helping bring this language into existence

[–] AMoistGrandpa@lemmy.ca 16 points 3 weeks ago

I think you've just invented Jsonnet, but with C integration.

https://jsonnet.org/

load more comments (1 replies)
load more comments (3 replies)
[–] Solemarc@lemmy.world 23 points 3 weeks 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.

[–] Ephera@lemmy.ml 9 points 3 weeks ago

I don't feel like it will stray very far from what's dubbed "TOML 0.1" in the meme. Yes, it has inline tables and as of TOML 1.1, they're allowed to span multiple lines, so it's technically not anymore illegal to do what's in the meme. But all things considered, this is still a miniscule change compared to TOML 1.0.

[–] Klear@quokk.au 21 points 3 weeks ago (2 children)

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

[–] _stranger_@lemmy.world 12 points 3 weeks 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).

load more comments (1 replies)
[–] JohnSmith@feddit.uk 9 points 3 weeks ago

Calm down, kids. These issues were resolved a longtime ago by ASN.1

load more comments
view more: next ›