JSON vs YAML

JSON to transfer data, YAML to write configuration files.
Prove me wrong.

Attached: json_yaml.png (549x349, 29K)

YAML looks more prettier and therefore better
/thread

YAML can't be minified

>more prettier
>threading your own post
Worthless opinion anyway

Attached: IMG_20180911_022601.jpg (580x581, 39K)

Json.
I have never used yml

Attached: mustafa-kemal-ataturk-20968109-1-402.gif (300x300, 54K)

Json all the way, fuck everything else and especially xml

YAML is an utter shitshow. Its syntax only looks simple at first, but it's a mess of special cases and traps. It's whitespace-dependent and hard to parse safely. All in all, JSON is better as a config language just by the virtue of not being YAML.

>It's whitespace-dependent
That's a good thing.

"No"

if you're using js, just use js to write your config files. that way you can have comments and shit

What's with the quotes? That's also a problem with JSON. You already have the colon to separate the name from the value. Why do you need those extra quotes?

>Why do you need those extra quotes?
The name could be any string. SO you need only one lexer rule: string. Otherwise you'll need to introduce an ident lexer rule. Trust me, it's better that way.

JSON to transfer data (if you must transfer it to a browser or as plain text), SDL,INI,TOML,JSON5,HSON,... to write configurations, YAML into the trash.
>That's also a problem with JSON
kek

It is a problem. Let's say you're programming and you need to make an int called i. Do you need to put i in quotes like "i"? No, because that's fucking retarded, and it looks just as retarded in JSON. YAML looks clean and comfy, with a timeless quoteless name declaration combined with the sane whitespace-dependent innovation similar to python

>Otherwise you'll need to introduce an ident lexer rule.
How truly horrible.
>Trust me
no u

I don't doubt it's not great but YAML isn't the answer. And like Python, it isn't timeless.

And by the way how do you encode
{ "f: [],g" : 123 } Without those quotes?

this, json for data transfer and toml for config

why would I omit quotes in this case?
>but it's handwritten
why would I insert a retarded key like this in this case?

>why would I omit quotes in this case?
So you want to annoy everybody with an if/then/else?
>why would I insert a retarded key like this in this case?
I just hear a whining baby.

you are dense now, aren't you?

Yaml is overcomplicated garbage. Use toml.

This. What a fucking garbage syntax. It's worse than Python by a lot.

JSON isn't without its flaws either, but at least the syntax is very straightforward and consistent. My one gripe with JSON is the fact that comments are not valid JSON. Makes it a real pain for configuration files or even simply JSON files that you might check into source control for unit tests or something, should you want to document what each key means.

Do you need to put comments inside rows of a DB? That's the reason why there is no comments in json.

How does YML deal with spaces and special characters in variable names?

>YAML to write configuration files.

sqlite is a better, more reliable form of storing data used by a program.

I do, it's called the "COMMENTS" column and it's meant just for that.

It's not in each row. It's in the table description. What are the json files? The rows or the table description?

shit opinion

>not using a binary format for data
why

YAML has some nice referencing so it encourages re-use for config files, very helpful when your configuration structures are somewhat involved.

>Install Ubuntu 18.04
>They took away my /etc/network/interfaces file and introduced some sort of yaml shit show
>Just to add another eth interface on a local only subnet I have to write like 5 lines and make sure my indenting is correct
th-thanks ubuntu

here is a (contrived) example

ethernets:
enp3s0:
dhcp4: true
enp4s0:
addresses:
- 192.168.0.10/24
gateway4: 192.168.0.1
mtu: 1480
nameservers:
addresses:
- 8.8.8.8
- 9.9.9.9
net1:
addresses:
- fe80::a00:10a/120
gateway6: fe80::a00:101
match:
macaddress: 52:54:00:12:34:06
net2:
dhcp4: true
dhcp6: true
match:
macaddress: 52:54:00:12:34:07
mtu: 9000

this has nothing to do with the parser being hard you dumb fucks
crockford already explained the quotes are necessary to make it compatible with javascript without making any modifications to the parser

this is dumb shit either way, if you want efficient transfers use protobufs

how would you use '"::;===---"""''""""': as a key?
you escape them you braindead dickface

*.csv

Confession: I dislike JSON solely because the name stands for JavaScript Object Notation. I hate Javascript and anything associated with Javascript. If the same format had no association with JS I probably wouldn't mind it at all.

just use a configuration language like a man

I actually felt this way for a long time too.

>man child

javascript is unironically the best high level language

/thread

JSON would be the rows of data.

>yaml can't be minified
>what is gzip

Flatbuffers to transfer data,
Sexps to write configuration files.
Prove me wrong.

csv for data and configuration

JSON is a subset of YAML.

>YAML can't be minified
You don't know YAML.

Also, why would you minify a config file?

yaml is so fucking bad

>the quotes are necessary to make it compatible with javascript
Javascript is perfectly happy without quotes around the key.
let obj = {
foo: "bar"
}
is perfectly valid Javascript

>comments are not valid JSON.
this makes it 100% useless for config

YAML for config, as I said. It's inefficient to do data transfers when bits count.

You can minify and compress JSON. With YAML, you cannot get rid of newlines and tabs

they both suck ass.

You don't have to "minify" shit if you encode it in an efficient binary format beforehand.

do you know how to traverse trees in javascript?

you do this. `foo["bar"]["baz"]["cunt"];` you need to use actual strings. The non-string part of JS objects is more of a convenience.

YAML for when a human needs to touch it or define things, JSON otherwise or whatever is better suited when moving data between/from services.

"happened to work because javashit is a fucking loose ass mess" doesn't mean "perfectly happy":
let obj = {
let: "bar",
for: "bar"
}

You're not going to check in a SQLite database and do diffs between that in vcs, it might make sense for something with heaps of configuration that also needs to store data. For most things a plain file in YAML/JSON on disk will suffice.

there is nothing more horrible than editing json. One bad comma and it will crash, you cant comment code, even error messages are not helpful

>foo["bar"]["baz"]["cunt"]
foo.bar.baz.cunt also works just fine, and I don't see how accessor notation has to do with declaration syntax

Json is a human readable transport format

not a configuration format

Lmao, just use Lua tables for storing data :^)

Attached: evil.png (235x937, 13K)

That's basically the same as JSON. Just replace the "=" with ":", and you have JSON.
>YAML
>Whitespace dependent
in the trash it goes.

That is basically json with a few extra syntax.

XML all the way. Faggots.

The web could have been such a great thing. XHTML, XSLT, XPATH, and everything is nice and dandy.
And then you fucking webmonkies fucked it all up, because you couldn't get your stupid html tags right. I hate you all.

YAML is for Mac OSX consumeritards to feel more special.

XML, and JSON are the only ones that make sense.

>Java
>JAXB
No need for a proper schema, and it's robust enough to extend and tweak stuff along the way. Extra nice.

Attached: 1491077626187.jpg (647x587, 61K)

>XML fag
literally fuck off

The XML ecosystem is amazing. All the power you get for free. But no, let's drop that, and reinvent the fucking wheel because muuhh soo verbose, muuh namespaces. Who's the faggot again? XSLT alone renders so many shitty apps redundant. All in a few lines.

>valid json data is valid yaml data too
>somehow json can be smaller

It is allowed to quote strings, but not strictly necessary.

XML is bloated shit in every respect

Whitespace can't be removed in yaml

Bracket notation is useful since you can use logic inside of them. If you want to predefine what you’re going to access you can (foo.bar.baz.cunt) but if you need to access properties based on the result of some logic you can use bracket notation.

if (Math.random() > 0.5) {
var key = "bar"
} else var key = "quux";

console.log(foo[key]);

YAML to write configuration files, ASN1 to transfer data

json for everything
javascript for everything

>not using protobufs or flatbuffers

Yay, I always wanted to learn an extra programming language just to manipulate fucking angle brackets. Let's invent a DSL for performing string operations and arithmetic too, while we're at it.

sloppy custom stateful parser > yaml

those colons are absolutely unnecessary

>>what is gzip
communist shit?

Toml is comfy for configuration

INI>JSON>XML>onions powered shit like yaml