News for hackers. Stuff that matters.
Re:The Pretty JSON Revolution by augusto-moura on Tuesday February 23, 2021 @11:26AM (#26239171)
The position of commas in the rgb array are triggering me

Numbers to the right make it much more pleasant to my eyes

    {
      "colors": [
        { "color": "black",   "hex": "#000", "rgb": [   0,   0,   0 ] },
        { "color": "red",     "hex": "#f00", "rgb": [ 255,   0,   0 ] },
        { "color": "yellow",  "hex": "#ff0", "rgb": [ 255, 255,   0 ] },
        { "color": "green",   "hex": "#0f0", "rgb": [   0, 255,   0 ] },
        { "color": "cyan",    "hex": "#0ff", "rgb": [   0, 255, 255 ] },
        { "color": "blue",    "hex": "#00f", "rgb": [   0,   0, 255 ] },
        { "color": "magenta", "hex": "#f0f", "rgb": [ 255,   0, 255 ] },
        { "color": "white",   "hex": "#fff", "rgb": [ 255, 255, 255 ] }
      ]
    }
Re:The Pretty JSON Revolution by Zecc on Tuesday February 23, 2021 @11:40AM (#26239365)
> The position of commas in the rgb array are triggering me

You mean:

    {
      "colors": [
        { "color": "black"  , "hex": "#000", "rgb": [   0,   0,   0 ] },
        { "color": "red"    , "hex": "#f00", "rgb": [ 255,   0,   0 ] },
        { "color": "yellow" , "hex": "#ff0", "rgb": [ 255, 255,   0 ] },
        { "color": "green"  , "hex": "#0f0", "rgb": [   0, 255,   0 ] },
        { "color": "cyan"   , "hex": "#0ff", "rgb": [   0, 255, 255 ] },
        { "color": "blue"   , "hex": "#00f", "rgb": [   0,   0, 255 ] },
        { "color": "magenta", "hex": "#f0f", "rgb": [ 255,   0, 255 ] },
        { "color": "white"  , "hex": "#fff", "rgb": [ 255, 255, 255 ] }
      ]
    }
Re:The Pretty JSON Revolution by mschuetz on Tuesday February 23, 2021 @01:51PM (#26241190)
You mean:

    {
      "colors": [
        { "color": "black"  , "hex": "#000", "rgb": [   0,   0,   0 ] },
        { "color": "red"    , "hex": "#f00", "rgb": [ 255,   0,   0 ] },
        { "color": "yellow" , "hex": "#ff0", "rgb": [ 255, 255,   0 ] },
        { "color": "green"  , "hex": "#0f0", "rgb": [   0, 255,   0 ] },
        { "color": "cyan"   , "hex": "#0ff", "rgb": [   0, 255, 255 ] },
        { "color": "blue"   , "hex": "#00f", "rgb": [   0,   0, 255 ] },
        { "color": "magenta", "hex": "#f0f", "rgb": [ 255,   0, 255 ] },
        { "color": "white"  , "hex": "#fff", "rgb": [ 255, 255, 255 ] },
      ]
    }
Re:The Pretty JSON Revolution by jng on Tuesday February 23, 2021 @02:52PM (#26242018)
The last extra comma is valid javascript, but, (possibly) unfortunately, invalid JSON.
Re:The Pretty JSON Revolution by jng on Tuesday February 23, 2021 @02:53PM (#26242037)
Exactly. I format things like that in my source code. Anything else is too painful to bear. When code by other people who don't care about those things, it's hard to understand :)
Re:The Pretty JSON Revolution by Pxtl on Tuesday February 23, 2021 @04:02PM (#26242856)
And then somebody wants to edit the file your careful alignment gets gradually mangled and there's no tooling to auto-do it and we refactor something globally and it gets worse and ultimately I go shift-alt-F to restore it to autoformatted sanity.