7 ms·
I mean one which doesn't have many similar, but variable, content structures, and/or which depending on the attributes of one of the elements. I had to deal wi
by stock_toaster 10y ago
I mean one which doesn't have many similar, but variable, content structures, and/or which depending on the attributes of one of the elements.
I had to deal with large volumes of json (think log streams) that while they shared many top level attributes, also had had accreted many "optional" components with "types" that depended on the values of certain attributes (each with different nested elements too). While awkward to deal with in python (lots of `if x in y['thing']` checks), this was very cumbersome to deal with in Go. It required lots of reflection and ended up being comparatively slow (python json parsing is actually pretty zippy).
It just isn't one of Go's stronger suits in my opinion.
- inimino 10y agoOK. Interesting. One of the benefits of JSON is that it is ad-hoc extensible. Otherwise why not use an efficient binary format? When more strongly typed environments add JSON support they often screw this up, which is unfortunate. Maybe an opportunity for someone to write another library to better support more idiomatic usage of JSON.
- stock_toaster 10y agoYup. I agree with pretty much everything you said.