News for hackers. Stuff that matters.
Re:Ask HN: When does it make sense to roll your own X? by RantyDave on Sunday July 14, 2019 @03:40AM (#20432239)
C structs are really, really brittle; CSV is alarmingly complicated (unicode); JSON can't pass "None". I like CBOR, myself.
Re:Ask HN: When does it make sense to roll your own X? by nyuszika7h on Sunday July 14, 2019 @05:07AM (#20432498)
> JSON can't pass "None"

What about null?

Re:Ask HN: When does it make sense to roll your own X? by RantyDave on Sunday July 14, 2019 @07:51PM (#20437040)
Ahh, then I might be talking crap. I'll check it out, thanks.
Re:Ask HN: When does it make sense to roll your own X? by acoard on Monday July 15, 2019 @11:45AM (#20441907)
You can pass null, undefined, or remove the property.

JSON Schema – a whole topic unto itself – gives you further control over locking down how this can be represented (e.g. field MUST be present but can be string matching this regex or null).

Re:Ask HN: When does it make sense to roll your own X? by CoolGuySteve on Sunday July 14, 2019 @10:59AM (#20433753)
CBOR has extremely slow encoding/decoding in C/C++ when compared to structs. Nothing is perfect.
Re:Ask HN: When does it make sense to roll your own X? by RantyDave on Sunday July 14, 2019 @07:49PM (#20437025)
For sure, compared to structs. Which you can almost certainly RDMA from one place to another. It's a little bit apples and oranges though since CBOR is self describing (and very lightly compressed).

Shameless plug: https://github.com/RantyDave/cppbor