Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well in Java, if your JSON library doesn't have a single function to call for deserialize or serialize, it's either a poor library or you should be able to wrap the complicated part in a function that makes it a one-liner. The Jackson library for instance has ObjectMapper.readValue() and ObjectMapper.writeValue() which are both one-liners.

My main point though is that writing in JavaScript doesn't naturally make it easier to work with JSON than any other language with similar functions to serialize/deserialize JSON.



I'm not a Java coder so I'll take your word on it about library support, I've only used the JSONObject, JSONArray, etc. classes. Surely you will concede that JSON being modeled after JavaScript gives the language a little bit of a leg up?


Not really. In theory, it's an advantage in that you can reuse the parser and avoid loading another, but in practice, that's only really important in the browser, not on the server, where the lib will be permanently loaded anyway.

And JSON values map 1:1 to native data structures in most languages - in fact, JSON can be parsed as Python code with the exception of the \/ escape.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: