Jason

Languages and libraries

json library

SHOW HN2014

106points
49comments
#264of 2,272 in 2014
Top 12%of 2014 by points

How HN took it

DebatedReal support and real criticism

3 positive, 4 neutral or asking, 0 mixed, 3 critical, out of 10 comments about the project. Thread score -0.05.

Idea: 3 for, 0 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Useful for dynamic JSON structures where encoding/json is clunky

    From 2 comments
    • This looks like a good approach to dealing with heterogeneous JSON! (ie, JSON that has an unknown and/or variable structure.) I've always found encoding/json a little clunky for…
      chimeracoder on HN
    • This. If your main use case is JSON as a serialized representation of the ever same object (plus or minus a few optional fields), encoding/json is by far the fastest and most…
      endymi0n on HN

Objections

  • Name is confusingly similar to the word JSON and a common first name

    From 2 comments
    • I would stray away from making the library name too similar in phonetic sound to the data it's meant to process. There was already enough confusion in an office I worked at with…
      danso on HN
    • Come on, there's a huge middle ground between "Unicorn milk" and a name that isn't a homophone of the format it works with. Let alone the fact that I don't like my first name…
      deadbeef404 on HN
  • Name conflicts with an existing Mac JSON editor

    From 1 comment
    • The name is a little "unfortunate", give that there's a JSON editor for Mac OS X with the exact same name.
      gorbachev on HN

Questions

  • Why not just use encoding/json with interface{} or RawMessage

    From 2 comments
    • I would say the most idiomatic way is having defined structs and using encoding/json. Even when you don't know the json schema in advance you can still parse it into an…
      anonfunction on HN
    • > There is no easy way to sort of "parse" json piece by piece, which is what this library provides Well, you can use json.RawMessage to delay decoding until other values are…
      chimeracoder on HN

Alternatives named

  • encoding/json with interface{}

    From 2 comments
    • I would say the most idiomatic way is having defined structs and using encoding/json. Even when you don't know the json schema in advance you can still parse it into an…
      anonfunction on HN
    • Passing a pointer to a struct is just one way to use the standard Go package. You can also pass a pointer to an interface{}, []interface{} or map[string]interface{} depending on…
      BarkMore on HN
  • gojson and json-to-go struct generators

    From 2 comments
    • This looks like a good approach to dealing with heterogeneous JSON! (ie, JSON that has an unknown and/or variable structure.) I've always found encoding/json a little clunky for…
      chimeracoder on HN
    • (Another plug here) I did too! Except it runs in the browser: https://mholt.github.io/json-to-go And I agree with you about the complementary aspect. Sometimes you can't control…
      mholt on HN
  • zhash

    From 1 comment
    • ...or use very simple lib like this one [1] to access to deep-nested structs using one call. [1] https://github.com/zazab/zhash
      seletskiy on HN
  • simplejson-go

    From 1 comment
    • this looks quite familiar: https://github.com/likexian/simplejson-go if anyone is interested i did some slight modifications to the project above which are keep in my personal…
      w4rh4wk5 on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/8687740)