News for hackers. Stuff that matters.
Re:Why we moved from NodeJS to Ruby on Rails by MatthewPhillips on Monday May 14, 2012 @03:32PM (#3972734)
Not any other language. In JavaScript there is 1 function call to serialize and 1 function call to deserialize. In Java it's much more complicated, for example.
Re:Why we moved from NodeJS to Ruby on Rails by brown9-2 on Monday May 14, 2012 @03:35PM (#3972748)
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.

Re:Why we moved from NodeJS to Ruby on Rails by MatthewPhillips on Monday May 14, 2012 @03:41PM (#3972786)
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?
Re:Why we moved from NodeJS to Ruby on Rails by icebraining on Monday May 14, 2012 @08:18PM (#3974122)
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.