2 ms·
Haskell culture tends to do this kind of stuff for records, FWIW. Of course, in this case, it might even make sense to render this in a way such as the followin
by sham1 2y ago
Haskell culture tends to do this kind of stuff for records, FWIW. Of course, in this case, it might even make sense to render this in a way such as the following:
{
"foo": "bar"
, "baz": "hehe"
, "yes": "aligned"
, "better": "this way"
}
Because as another person already said, the first line isn't movable, and the last line wasn't either. The first key-value pair does look a tad strange because it doesn't have anything before the key, but nevertheless, now changing things is even easier.
Admittedly, it would look nicer if we could have trailing commas, though. Oh well, we have YAML for extra readable record syntax, even with how horrible YAML can get in reality.
- EGreg 2y agoMy opinion: just have commas be optional, like semicolons. Allow linebreaks to insert implied commas