this post was submitted on 13 Nov 2023
108 points (82.5% liked)

Programmer Humor

19544 readers
534 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 1 year ago
MODERATORS
 

And I'll show you YAML

(a continuation of this post)

you are viewing a single comment's thread
view the rest of the comments
[–] interolivary@beehaw.org 47 points 1 year ago* (last edited 1 year ago) (2 children)

There's a special place in hell for the inventor of semantically significant whitespace.

YAML itself is one of the circles of hell. You have to copy-paste YAML from web etc sources with dubious formatting for all eternity, and the editor doesn't have YAML support. Also you can only use Python

[–] magic_lobster_party@kbin.social 14 points 1 year ago* (last edited 1 year ago) (1 children)

Indenting copy pasted yaml is always a pain in the butt. Any indentation you give is likely a valid yaml. Especially bad considering indentation has a significant meaning. You have to double check back and forth to ensure nothing bad has sneaked in.

With JSON there are no such discrepancies. It’s likely the editor has figured it out for you already. If it hasn’t it’s easy to prettify the JSON yourself.

[–] interolivary@beehaw.org 5 points 1 year ago

Semantic whitespace problems can easily be literally impossible to solve automatically. One of the dumbest fucking ideas anybody ever came up with in computing and its inventor if anyone belongs in YAML Hell. As a fuckup it's not quite as bad as null, but that ain't exactly a high bar

[–] synae@lemmy.sdf.org 3 points 1 year ago (1 children)

Sounds like a good time to me!

[–] interolivary@beehaw.org 4 points 1 year ago (1 children)

I'm not sure which thought is scarier: that you don't know what you're signing up for, or that you do know and you enjoy fixing undecidable formatting fuckups manually

[–] synae@lemmy.sdf.org 2 points 1 year ago

There's a bonus third option: I started writing python professionally in 2007 and nowadays spend 75% of my "hands on keyboard" time working on kubernetes YAML and I am indeed having a good time.

I admit, I hastily misread the tail end of your comment as (e.g.) "A reason YAML is bad because you have to copy-paste from the web and that sucks"; not as you probably meant it "in this special hell, you must deal with copy-pasted nbsp and other trash". So maybe I did not know exactly what I was signing up for ;)

I don't deal with anything like that and not entirely sure how it happens to people enough that it is a common complaint. "undecidable formatting fuckups" are a non-issue in my life, I really don't understand how people encounter such things. Maybe they need to fix their editor/IDE/tools? Skill issue? IDK.

As a tangent- I don't care what language code is written in, it had better be indented properly (and linted, and follow the project's codestyle, ...). Our juniors learn pretty early that their change requests will be blocked on formatting alone by CI, and a human won't even bother reviewing the substance of their change if they don't follow convention. I don't hear them ever complaining about any of these things, least of all semantic whitespace ... and we have a rich culture of bitching about menial/pedantic things ;)