this post was submitted on 24 Feb 2026
573 points (98.2% liked)

Programmer Humor

30013 readers
1964 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
 
you are viewing a single comment's thread
view the rest of the comments
[–] artifex@piefed.social 202 points 1 day ago (4 children)
[–] Valmond@lemmy.dbzer0.com 72 points 1 day ago (4 children)

Chuck in comments and I'm on board.

[–] socsa@piefed.social 2 points 12 hours ago

_comment: "this is a comment"

[–] luciferofastora@feddit.org 18 points 1 day ago (2 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"
}
[–] AlexanderTheDead@lemmy.world 1 points 2 hours ago

I'm not a real programmer but I was wondering wtf you're on about because I don't think I've ever worked with a json file in a system that didn't use // for comments lmfao

[–] The_Decryptor@aussie.zone 13 points 20 hours 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 6 points 13 hours 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.

[–] luciferofastora@feddit.org 6 points 18 hours ago

People went on to use JSON for human readable configuration files

Speaking from my own experience, "I could also use this for..." seems to be a ubiquitous programmer affliction. Single-purpose tools that are great at their thing tend to be short-lived unicorns until someone starts sticking other parts onto them for additional functionalities, taking off the horn because it's in the way for some thing or other, and somehow we end up with yet another multi-function-tool that does a lot of things poorly.

[–] panda_abyss@lemmy.ca 88 points 1 day ago (1 children)

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

[–] Valmond@lemmy.dbzer0.com 28 points 1 day ago (1 children)
[–] panda_abyss@lemmy.ca 38 points 1 day ago (1 children)

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

[–] Valmond@lemmy.dbzer0.com 10 points 1 day 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.

[–] panda_abyss@lemmy.ca 5 points 1 day ago

I’ve spent hours on that, and debugging missing commas between string literals. Even on separate lines you’re not safe from implicit concatenation.

[–] Anafabula@discuss.tchncs.de 24 points 1 day ago (1 children)

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

[–] Valmond@lemmy.dbzer0.com 10 points 1 day ago

That seems quite good, not overdoing it too.

[–] marcos@lemmy.world 38 points 1 day 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 32 points 1 day ago (2 children)

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

[–] protogen420@lemmy.blahaj.zone 10 points 22 hours ago (1 children)
[–] SlurpingPus@lemmy.world 2 points 22 hours ago (1 children)

Funny thing, Lisp structures are converted pretty easily to xml/html, so of course there are packages for Lisp varieties allowing one to write html in Lisp. (Similar to Pug, but with parentheses.)

[–] protogen420@lemmy.blahaj.zone 2 points 18 hours ago

yes, xml came from SGML which has influences from lisp, lisp can be used to represent xml 1 to 1 they have the same data model

[–] owsei@programming.dev 51 points 1 day ago (2 children)
[–] tetris11@feddit.uk 3 points 22 hours ago* (last edited 22 hours ago)

Not many people realise this, but Hanibal's dad Hamilcar Barca had a lisp, and used his knowledge of abstract syntax trees and delayed execution to deforest parts of the Himalayas in order to let his elephant of a son through.

[–] otter@lemmy.dbzer0.com 1 points 1 day ago

The plural for said zealots'd be Cartholth? (singular: Carthole)

[–] dohpaz42@lemmy.world 5 points 1 day ago (1 children)

That’s not JSON. Note the use of equal signs for the property names. That’s something else.

[–] ulterno@programming.dev 23 points 1 day ago* (last edited 1 day ago) (2 children)

Equals schmequals.
It could be a and it would be the same as JSON because it is still a single symbol used as a separator.

a distinction without a difference

Now, if it took multiple separators, each giving some specific different meaning, then it would be a something else.

[–] jcorvera@quokk.au 3 points 1 day ago (2 children)

It could be a ⇨ and it would be the same as JSON because it is still a single symbol used as a separator.

Nah, that's a Ruby Hash...

[–] PumaStoleMyBluff@lemmy.world 2 points 1 day ago

Excuse me, it's a Ruby Hash Rocket.