News for hackers. Stuff that matters.
Re:The melting pot of JavaScript (2017) by Traubenfuchs on Tuesday January 08, 2019 @04:46AM (#18854462)
> doing JSON in Java is an ugly, ugly thing

Why do you think so? Jackson and Gson work very well. Serialising and deserialising from/to POJO/JSON is trivial with them.

Re:The melting pot of JavaScript (2017) by sonnyblarney on Tuesday January 08, 2019 @12:59PM (#18857707)
JSON and Javascript data objects are essentially directly interchangeable.

In Java, you have to abstract the document and write a lot of code to access, add, remove things etc. - or - because there is no such thing as an untyped POJO in java, you have to set up a ton of things if you want to use real objects.

Re:The melting pot of JavaScript (2017) by Traubenfuchs on Wednesday January 09, 2019 @03:04AM (#18863119)
Instead of using a typed POJO you can deserialize/serialize a Map<String, Object>.

You could also use a POJO for the fields you know and put a map inside for the fields you don't know.

If that's not enough you can use JsonNode, or ObjectNode where you can freely add and remove json values.

Re:The melting pot of JavaScript (2017) by sonnyblarney on Wednesday January 09, 2019 @08:39AM (#18864559)
Ok, touché, good point.