Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
C0D4681386yOther then Ci/CD most devs wouldn’t have a use for YAMl, also with the MS taker over of Github, a lot of projects ended up in GitLab where Ci/CD is free and shoved in your face on repo creation.
-
C0D4681386y@ScriptCoded I use it for all my personal projects, where as “the company” pays for github for work repos.
It’s basically the same as github + free private repos, free Ci/CD hours per month and if you don’t want cloud based repo storage, they do have a self hosted version as well. -
The rise in interest in yaml is not proportional to the decrease of interest in json. I doubt yaml is the reason here
-
Npstr6596yJson and Yaml have very different use cases. Json is really nice for encoding data in text, but it sucks for humans to read, you can't even use comments. Yaml is one of several languages that fill that human friendly configuration language gap.
-
musician9426yYou can comment in yaml. Thats sometimes useful. Also its better readable. Indentation isnt an issue if you code in an ide/editor with suppor5 for it.
Well in the end I use json anyway but I actually like yaml more. -
@Npstr @musician Yeah, comments are nice. You'd have to use JSONC for that. But let's say your colleague prefers working with tabs, and you with spaces. Most likely you will have some sort of guidelines for that, if not event restrictions, but there are cases when a tab slips in somewhere. That gets crazy annoying when you're halfway through CI/CD pipeline.
-
musician9426y@ScriptCoded I see what you mean but thats one of the reasons you need to use a precommit hook which autoformats the code to the companies standard imo
-
Npstr6596y@ScriptCoded Use a proper formatter. If your IDE does not support formatters, use a proper IDE. Also a team not using a common formatter sounds horrific.
-
all valid Json is valid yaml. also yaml has comments. so that right there means it's json+comments+a bunch of other mazing stuff.
let's talk about that other stuff:
- more readable
- better formatting
- hey look this intuitive bulleted list style is valid yaml
- wow that make so much sense!
- more popular than any other json superset out there.
my point: if you aren't using JavaScript, and therefore need a library to use JSON, opt for a YAML library instead. your files will still work and your sysadmins/technical power users will thank you. -
@ScriptCoded I have never once experienced an indentation error, nor does any standard or specifications I can find require any specific way.
I don't think yaml even requires indentation at all but I could be wrong. also are you mixing tabs and spaces like a monster? can you please provide us a YAML file that fails to parse because of indentation? I'm legitimately curious now. -
@deadPix3l Yes, YAML is indentation sensitive. It uses whatever indentation the file uses
Related Rants
See that dip in JSON in 2018? It's countered by a slight rise in YAML. According to this article, it's because of all CI and Docker services. Can't think of many reasons to use YAML above e.g. JSON.
https://theregister.co.uk/AMP/2018/...
rant
xml
yaml
json