60
Why YAML sucks? (programming.dev)
submitted 1 week ago* (last edited 1 week ago) by heikkiket@programming.dev to c/programming@programming.dev

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
[-] Windex007@lemmy.world 84 points 1 week ago

Any language in which whitespace has syntactic value is intrinsically flawed.

Can't speak to your specific issues, but that's why yaml will always suck.

[-] eager_eagle@lemmy.world 6 points 1 week ago* (last edited 1 week ago)

YAML sucks because, among other things, indenting it is not obvious.

In contrast, the only mistake of Python when it comes to whitespaces was allowing hard tabs, which makes it too easy to mix them if your editor is not configured.

Improper indentation stands out more than missing or unbalanced braces and it's really not an issue to delimit code blocks.

[-] ugo@feddit.it 8 points 1 week ago

Hard tabs are the only accessible option though. If you care about developers with a different vision capability than yours, the only correct indentation choice is tabs.

If, because of bad vision, someone needs to crank the font size way up, it’s very possible that they might need to work with a tabstop of 3, 2, or even just 1 space.

With tabs, this is user configurable. With spaces it isn’t.

[-] tyler@programming.dev 1 points 1 week ago

In any modern editor it is configurable with spaces too

[-] ugo@feddit.it 1 points 1 week ago

What “it” is configurable? If the code is indented with 4 spaces, it is indented with 4 spaces. You can configure your editor to indent with 1 space if you want, but then your code is not going to respect the 4 spaces of indentation used by the rest of the code.

I repeat, the only accessible indentation option is using tabs. This is not an opinion because every other option forces extra painful steps for those with vision issues (including, but not limited to, having to reformat the source files to tabs so they can work on them and then reformat them back to using spaces in order to commit them)

load more comments (36 replies)
this post was submitted on 06 Sep 2024
60 points (73.4% liked)

Programming

16996 readers
93 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 !webdev@programming.dev



founded 1 year ago
MODERATORS