4 ms·
JSON compatibility, to be able to copy and paste from JSON to valid nested dynamic arrays. a = { "a": "a", "b": {"b": 2} } Optional commas at the
by pmontra 4y ago
JSON compatibility, to be able to copy and paste from JSON to valid nested dynamic arrays.
a = {
"a": "a",
"b": {"b": 2}
}
Optional commas at the end of lines, so this is also valid
a = {
“a“: "a"
"b": {"b": 2}
}
and we are able to swap or append lines without editing the commas or forgetting to do it and get a syntax error. Mandatory commas on all lines would do but it gets in the way of JSON compatibility.
This must also be legal code and equivalent to the previous one
a1 = {
a: "a",
b: {"b": 2}
}
a == a1 # true
The developer decides when saving typing time is more important than JSON compatibility.
PS: a big yes to kebab-case too. That's in part CSS compatibility because CSS class names are often kebab cased.