There exists a peculiar amnesia in software engineering regarding XML. Mention it in most circles and you will receive knowing smiles, dismissive waves, the sort of patronizing acknowledgment reserved for technologies deemed passé. "Oh, XML," they say, as if the very syllables carry the weight of obsolescence. "We use JSON now. Much cleaner."

you are viewing a single comment's thread
view the rest of the comments
[–] 6 points 9 months ago (7 children)

CSV >>> JSON when dealing with large tabular data:

  1. Can be parsed row by row
  2. Does not repeat column names, more complicated (so slower) to parse

1 can be solved with JSONL, but 2 is unavoidable.

  • source
  • parent
  • hideshow 7 child comments
  • [–] 3 points 9 months ago* (2 children)
    {
        "columns": ["id", "name", "age"],
        "rows": [
            [1, "bob", 44], [2, "alice", 7], ...
        ]
    }
    

    There ya go, problem solved without the unparseable ambiguity of CSV

    Please stop using CSV.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 9 months ago (1 child)

    Great, now read it row by row without keeping it all in memory.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 9 months ago

    Wdym? That's a parser implementation detail. Even if the parser you're using needs to load the whole file into memory, it's trivial to write your own parser that reads those entries one row at a time. You could even add random access if you get creative.

    That's one of the benefits of JSON: it is dead simple to parse.

  • source
  • parent
  • [–] 2 points 9 months ago

    No:

    • CSV isn't good for anything unless you exactly specify the dialect. CSV is unstandardized, so you can't parse arbitrary CSV files correctly.
    • you don't have to serialize tables to JSON in the “list of named records” format

    Just user Zarr or so for array data. A table with more than 200 rows isn't ”human readable” anyway.

  • source
  • parent
  • [–] 1 point 9 months ago (2 children)

    Yes..but compression

    And with csv you just gotta pray that you're parser parses the same as their writer..and that their writer was correctly implemented..and they set the settings correctly

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 9 months ago (1 child)

    Compression adds another layer of complexity for parsing.

    JSON can also have configuration mismatch problems. Main one that comes to mind is case (in)sensitivity for keys.

  • source
  • parent
  • hideshow 1 child comment