r/ProgrammerHumor • • Sep 13 '18

Meme Writing YAML

Post image
646 Upvotes

88 comments sorted by

View all comments

Show parent comment

4

u/Athomeacct Sep 13 '18

Oh my god thats a million times better than <><><><><><><> all over XML

2

u/DoNDaPo Sep 13 '18

Maybe JSONx is something you want to consider then.

10

u/Kered13 Sep 13 '18

JSONx is an IBM® standard format to represent JSON as XML.

Dear god why.

-6

u/BadBoy6767 Sep 13 '18 edited Sep 14 '18

Not really imo, because at the expense of verbosity you get flexibility (exception being Java), and XML is ten times more flexible than YAML.

EDIT: Apparently I have to explain myself. YAML has keys, values, and nesting. XML also has attributes and named elements (unlike YAML in which there's just "objects"), it's also not indentation-based, which makes it a hell of a lot more readable for complicated structures.

Example:

- type: 'form'
  method: 'GET'
  action: '/api/login'
  enctype: 'multipart/form-data'
  children:
    - type: 'input'
      itype: 'text'
      placeholder: 'Name'
      name: 'name'

vs

<form method="GET" action="/api/login" enctype="multipart/form-data">
    <input type="text" placeholder="Name" name="name" />
</form>

XML manages to be 6 lines smaller, in fact smaller in general, as most of YAML is just spacing.