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?
- Vivendi ( @Vivendi@lemmy.zip ) 47•2 months ago
Can people stop hating on shit?
FOR FUCKS SAKE, negative reinforcement dopamine has RUINED THE FUCKING NET.
EVERYWHERE I GO there’s someone bitching about something, hate circlejerks are unbelievably popular, people just love to hate on stuff.
You’re ruining your thought patterns with all these social media negativity bullshit.
Fucking TOML users hate on fucking YAML fucking C++ users hate Rust fucking Rust users hate literally everything under the sun and are insufferable to work with
EVERYONE, fucking CHILL
- sip ( @sip@programming.dev ) 21•2 months ago
stop hating on rust devs
- Sir Gareth ( @beaumains@programming.dev ) 7•2 months ago
Yeah TBH I like yaml. Sure its not the best ever, but its not the worst it could possibly be.
For config its not terrible. For ansible playbooks its again… not terrible.
Why is everyone always hating on something which is just kinda mid.
- wewbull ( @wewbull@feddit.uk ) English4•2 months ago
Config is fine, but Yamls biggest problem is people use it to describe programs. For example: playbooks. For example: CI steps.
If YAML wasn’t abused in this way it would have a lot less hate.
- derpgon ( @derpgon@programming.dev ) 2•2 months ago
What’s wrong with using YAML for CI? I mean, I use it for Gitlab CI, the underlying script it runs is just Bash.
- wewbull ( @wewbull@feddit.uk ) English3•2 months ago
Right, so you just have a single step and then hand over to a proper script. I’ve seen many people try to put much more complex logic in there before handing over to a proper language.
- orcrist ( @orcrist@lemm.ee ) 5•2 months ago
No seeds no stems no stress my guy. The Internet is a great place for complaining. Readers can downvote and move on, everyone gets what they want.
- NaevaTheRat ( @NaevaTheRat@vegantheoryclub.org ) English36•2 months ago
Programmers hate everything. You could design a spec which serenades you with angel song and feeds you chocolate dipped grapes and someone would be like: This is awful, my usecase is being a dog.
- silverblade ( @silverblade@discuss.tchncs.de ) 7•2 months ago
This comment is underrated, even if it rises to the top of all comments.
- NaevaTheRat ( @NaevaTheRat@vegantheoryclub.org ) English4•2 months ago
Pleased to have touched your life with levity, stranger.
- FizzyOrange ( @FizzyOrange@programming.dev ) 6•2 months ago
Sure there aren’t many things that are universally loved. I mean I can’t really think of anything that doesn’t have some flaw.
But that doesn’t mean everything is equal! What would you rather program with, Visual Basic or Go? PHP or Typescript? If you polled people there are obvious winners.
- NaevaTheRat ( @NaevaTheRat@vegantheoryclub.org ) English3•2 months ago
Hey would you rather build from wood or steel?
What glue is better: 2 part epoxy or PVA?
Do you prefer soap or bleach as cleaning agent?
- FizzyOrange ( @FizzyOrange@programming.dev ) 3•2 months ago
Would you rather build from wood or tissue paper?
What glue is better: 2 part epoxy or pritt stick?
Do you prefer soap or ash as a cleaning agent?
- NaevaTheRat ( @NaevaTheRat@vegantheoryclub.org ) English2•2 months ago
Unlike tissue paper yaml is actually fit for purpose. I actually don’t know of any lang that literally can’t run a program. The most you could stretch what you’re saying to is that some esolangs are akin to making bricks of packed tissues to build with. They are art projects not serious submissions though.
I don’t like js as much as anyone else but as evidenced by reality it works. Programmers need to stop sniffing their own farts, you have such strong opinions about the most insane shit when at most you should be talking about narrower scopes for use and trade offs.
- ursakhiin ( @ursakhiin@beehaw.org ) 1•2 months ago
Different user here.
My only criteria for a backend language is it tells me something went wrong and where. Hence my distaste for JS.
- gencha ( @gencha@lemm.ee ) 21•2 months ago
Following along with the style of your own post: YAML doesn’t suck, because I feel so.
Thanks for asking.
- mox ( @mox@lemmy.sdf.org ) 20•2 months ago
One pattern I’ve noticed is people seeking a language that’s better than {JSON,XML,INI,etc} at wrangling their slightly complex configuration files, noticing the additional features and type support offered by YAML, and assuming it will be a good solution.
Then, as their configs grow ever larger and more complex, they discover that expressing them in YAML requires large sections of deep nesting, long item sequences, and line wrapping. The syntax style that they saw working well in other places (e.g. certain programming languages) breaks down quickly at that level of complexity, making it difficult for humans to correctly write and follow, and leading to frequent errors.
YAML doesn’t suck for small stuff, IMHO. (But it is more complex than necessary for small stuff.)
For things likely to grow to medium-large size or complexity, I would recommend either breaking up the data into separate files, or looking for a different config/serialization language.
- magic_lobster_party ( @magic_lobster_party@fedia.io ) 19•2 months ago
I don’t like YAML because it’s overly complicated. The specification is like 80 pages long. How the hell did they think that was a good idea?
JSON on the other hand is super simple. It doesn’t do more than it needs to.
Just compare this: https://yaml.org/spec/1.2.2/
With this: https://www.json.org/json-en.html
The entire JSON specification is shorter than just the table of contents of the YAML specification!
Another thing I like about JSON is that you can format it however you want with the whitespace. Want everything on one line? Just write everything on one line!
If data can be represented as a JSON, then there’s generally only one way to represent it in JSON (apart from whitespace). In YAML the same data can be represented in 1000s of different ways. You pick one.
- lemmyng ( @lemmyng@lemmy.ca ) English18•2 months ago
I will never forgive JSON for not allowing commas after the last element in a list.
- NostraDavid ( @NostraDavid@programming.dev ) 2•2 months ago
That lack of trailing comma has been the bane of my existence.
- verstra ( @verstra@programming.dev ) 11•2 months ago
This is the major reason for me. I really liked yaml, because it is way more readable to me than JSON. But then I kept finding new and more confusing yaml features and have realized how over-engineered it is.
Yaml would be great language if it had its features prunned heavy.
- state_electrician ( @state_electrician@discuss.tchncs.de ) 18•2 months ago
To paraphrase: There are two kinds of markup languages. Those that people complain about and those that nobody uses.
There is no silver bullet that will work perfectly for all use cases and we also don’t want to use 100 different tools. So people use things that aren’t perfect. But they’re good enough. I don’t think YAML is perfect and I still use it, because people know it and there are tons of tools already available.
- hex ( @hex@programming.dev ) 1•2 months ago
But it’s not a markup language… It’s for data serialisation…
- state_electrician ( @state_electrician@discuss.tchncs.de ) 6•2 months ago
I remember the time when YAML meant Yet Another Markup Language.
- 𝕽𝖚𝖆𝖎𝖉𝖍𝖗𝖎𝖌𝖍 ( @sxan@midwest.social ) 14•2 months ago
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.
- hades ( @hades@lemm.ee ) 13•2 months ago
I didn’t use yaml much while it was gaining popularity, and therefore didn’t pay much attention. But this article really made me pay attention and now I distrust anything that uses yaml in any capacity.
https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell
- biscuitswalrus ( @biscuitswalrus@aussie.zone ) 5•2 months ago
Great link.
- LyD ( @LyD@lemmy.ca ) 12•2 months ago
YAML works great for small config files, or situations where your configuration is fully declarative. Go look at the Kubernetes API with its resources.
People think YAML sucks because everyone loves creating spaghetti config/templates with it.
One reason it tends to become an absolute unholy mess is because people work around the declarative nature of those APIs by shoving imperative code into it. Think complicated Helm charts with little snippets of logic and code all over the place. It just isn’t really made for doing that.
It also forces your brain to switch back and forth between the two different paradigms. It doesn’t just become hard to read, it becomes hard to reason about.
- demesisx ( @demesisx@infosec.pub ) English10•1 month ago
I used to think json was the best until I found json lines or line delimited json. Thank me later. I use it all the time. You can append until you’re blue in the face. It’s great for log files. Each line is a valid json file.
- key ( @key@lemmy.keychat.org ) English9•2 months ago
I like yml. Clean to read, easy to use, supports comments.
- Gamma ( @GammaGames@beehaw.org ) English5•2 months ago
Way easier to type than json!
- NostraDavid ( @NostraDavid@programming.dev ) 1•2 months ago
and no possibility of (a lack of) trailing comma’s. Unless you use JSON inside Yaml, you heathens!
- roadrunner_ex ( @roadrunner_ex@lemmy.ca ) English8•2 months ago
I don’t hate YAML, but it has the same issues languages like PHP and JS introduce…there are unexpected corner cases that only exist because the designer wanted the language to be “friendly”
- katy ✨ ( @cupcakezealot@lemmy.blahaj.zone ) 8•2 months ago
it does what it needs to do: i don’t think it’s necessarily bad.
it’s for data not programming and it handles complex structures cleaner than json
- matcha_addict ( @matcha_addict@lemy.lol ) English5•2 months ago
My issue with it arises when data is not interpreted as I expected, like because of weird white space issues for example.
- ITGuyLevi ( @ITGuyLevi@programming.dev ) 7•2 months ago
I hated yaml with every fiber of my being when first had to use it, but I really wanted to use HomeAssistant and see what I could do with it. I hated it a bit less when I started using docker compose. I started loving it when I started using it as a way to explain json to non-programming IT types, trying to explain it without braces and brackets seems to get across easier. I guess its more human readable, but as a result formatting has to be spot on (those indents and spaces replace the need for brackets and braces).
One useful trick if you truly hate it but need it, write it in json, then just use a converter to change that into yaml.
- derpgon ( @derpgon@programming.dev ) 6•2 months ago
Fun fact, since YAML is a superset of JSON, any JSON is a valid YAML. You can still use pure JSON.
- GTG3000 ( @GTG3000@programming.dev ) 7•2 months ago
It’s inconsistent and annoying. Expressive, yes. Gets it’s job done, yes. Absolute nightmare of a spec, YES.
The fact that JSON is a subset of YAML should tell you everything about how bloated the spec is. And of course there’s the “no” funny things.
Personally, my favourite way to write configs was using lua (because it was already part of the project so why not), but JSON does fine.