26

I fucking hate YAML!!! Whoever thought a fucking whitespace delimited file was a good idea should......

</rant>
Ahh that's better; back to learning Ansible.

Comments
  • 14
    Python - the very same annoying problem.
  • 13
    Or even more moronic: makefiles where different kinds of whitespace have different meaning.
  • 5
    @Fast-Nop what??? Is that really a thing???
  • 2
    What would you rather use?

    I believe YAML is a superset of JSON, so you should be able to write it without whitespace mattering.
  • 3
    @netikras yeah. Use space where you need to have a tab, and the whole thing barfs with syntax error. Completely moronic shit.
  • 2
    @TheyCallMeMJ Idk... JSON is pretty messy to write manually. Think I finally got VS Code's indenting setup properly, so it's going better now. Just had me wanting to throw my keyboard for a while there with all the syntax errors.
  • 2
    YAML sucks but I prefer it over JSON for files that also need to be human-readable.
  • 2
    What's the alternative then, for hierarchical configuration files?
  • 3
    Just enable white space display as faint dot on your editor n enjoy YAML/python
  • 2
    I'm going to probably get flamed for this, but I hate bash scripting for the same reason, it's just so hacked-together and breaks so easily over tiny syntax issues compared to a modern language.
  • 4
    you know what, i'm just gonna say it:

    i love yaml. and i love python.

    brackets are for computers, and indentation is for humans. why not drop the fucking brackets when the computer can read indentation and we use it anyways?

    and if you can't configure your editor to automatically convert whitespaces, nothing can save you.
  • 1
    @RememberMe bash fucking sucks. Don’t get me wrong, I, for some reason, really enjoy writing bash scripts for automation. But it’s the automation part I like, not the language.

    Like, when do you need to use [ ] or [[ ]]. Or as you mention, the problem with white spaces: if [“$foo”=“bar”] vs if [ “$foo” = “bar” ]
  • 0
    PHP can have issues with white specs as well. I once worked on a Laravel project where I accidentally put a space before a <?php which made the entire site crash horribly...
  • 0
    Same here.
    I create everything json later convert to fucking yaml.

    Only one think i like yaml is comments thats it.
    Damn confusing with array and objects annoying
  • 0
    @devs because it has headers before it can execute anything.
  • 4
    Json is for data transfer, yaml is for configuration files. Can you honestly say, that it's easier to read a Json conf file, than a yaml conf file?
  • 0
    JSON is my baby
  • 1
    @KasperNS this. Exactly this. I tried writing an AWS Cloudformation template in JSON once and hated every second of it. YAML is much better in that case.
  • 1
    Whitespace and indentation should be used for readability.
    Brackets should be used for functionality.

    Python has some great stuff.
    Using indentation to control flow is not part of it.

    It's annoying how it insists to change basic syntax that everyone is already used to from other languages, with no tangible benefit or rationale.

    Like, "#". The major programming languages all support "//" for one-line comments. Why not allow that?

    And multi-line? god forbid use the "/* */" mainstream way that everyone is familiar with. In Python, we use ' """ '. Three double-quotes, to start and end a multi-line comment. God.

    It's like the emo millennial who needs everybody to see how special, unique, and snow-flaky he is.

    Well, Python (and YAML) may have their crowd of followers, but, on the most part, that is DESPITE their peculiarities, not because of them.
  • 0
    @obeobe A lot of people forget that Python is one of the oldest popular languages. Older than Java and Javascript. Things like shirking brackets and semicolons probably were super useful before advances in editors could handle this for you.

    My guess as to why comments are '#'? Probably to copy shell scripting, which I'm also guessing one of the main use cases of Python was in its beginning, that is to improve upon shell scripting.

    The multiline """ technically isn't even a comment. I believe it's a string value that actually gets evaluated, then immediately discarded. So technically Python doesn't have true multiline comments, but the triple quote saves you from prefixing each line with '#' to make it marginally easier to read.

    Not necessarily disagreeing with your points, just trying to justify some counterarguments.
Add Comment