this post was submitted on 06 Sep 2024
61 points (73.6% liked)

Programming

17000 readers
253 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
61
Why YAML sucks? (self.programming)
submitted 1 week ago* (last edited 1 week ago) by heikkiket to c/programming
 

I feel that Yaml sucks. I understand the need for such markup language but I think it sucks. Somehow it's clunky to use. Can you explain why?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 16 points 1 week ago (10 children)

It sucks the same way Python sucks. Some people just really don't like indentation-based syntax. I'm one of them, so I dislike both formats. However, if you groove on that sort of thing, I don't think YAML is any worse than any other markup.

Oddly, I get along with Haskell, which also used indentation for scoping/delimiting; I can't explain that, except that, somehow, indentation-based syntax seems to fit better with functional languages. But I have no clear argument about why; it's just an oddity in my aesthetics.

[–] [email protected] 11 points 1 week ago* (last edited 1 week ago) (9 children)

You can't say python's whitespace usage is as bad as yaml's. YAML mixes 2 and 4 spaces all the time. Python scripts don't run if you write this kind of crap.

And whitespaces is really just the tip of the iceberg of YAML problems...

[–] [email protected] 2 points 1 week ago* (last edited 1 week ago) (1 children)

YAML mixes 2 and 4 spaces all the time. Python scripts don't run if you write this kind of crap.

Sure it does. You only need to be consistent within a block. Python's syntax is ridiculous and solves problems that basically don't exist.

All of my java/kotlin/rust/etc. code is trivially well formatted and can be done by my editor. Moving code blocks is trivial. Refactoring is easier when I didn't need to hand -format the code just to make it work.

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