News for hackers. Stuff that matters.
Re:Java 9 features announced by mmastrac on Monday August 18, 2014 @01:47PM (#8193649)
The lack of an official JSON API has been a huge sore point for quite some time and has spawned dozens of libraries re-implementing the same thing over and over (GSON, Jackson, and even my own nanojson). I do hope that we avoid the DocumentBuilderFactory mistakes of XML and just end up with One True JSON implementation this time.
Re:Java 9 features announced by carsongross on Monday August 18, 2014 @02:03PM (#8193700)
Are you sure that's true? As you say, look at the "standard" API for XML parsing: a complete disaster. Dates, similar. Logging was slightly less disastrous because they took so much from Log4j, but they still made it unwieldy enough that the log4j guys ended up writing an API on top of that which everyone uses.

Now, props where props are due: Sun crushed the collections APIs compared to other languages at the time. And that more than makes up for everything else.

But I see little evidence that standardizing JSON parsing will improve things.

Re:Java 9 features announced by mmastrac on Monday August 18, 2014 @02:21PM (#8193786)
I'll counter that with saying that j.u.l is not actually that bad, IMO, although I might be the only one in the world that thinks that. I always just choose j.u.l in my projects because it works well-enough. I just shim anything with slf4j if it speaks log4j or commons-logging (shudder).

Perhaps Sun should have just adopted slf4j and a simple console-logging stub, but I don't think j.u.l is really any worse than the alternatives -- only a different implementation.

Now date APIs: those do suck, but I think the new Date JSR will finally get things to a place where we can use Java Dates rather than Joda.

Re:Java 9 features announced by wlievens on Monday August 18, 2014 @03:21PM (#8194111)
XML parsers are so complicated because XML and the DOM are more complicated. A json parser can be simpler.
Re:Java 9 features announced by sgarlatm on Monday August 18, 2014 @02:22PM (#8193791)
I really don't see any benefit of introducing a JSON API into the JDK. Jackson works great already. Are they really going to make something that much better?
Re:Java 9 features announced by mdaniel on Monday August 18, 2014 @03:55PM (#8194283)
There is an official JSON API: https://jcp.org/en/jsr/detail?id=353

But it is unclear how many of the existing implementations conform to it, and it definitely doesn't work toward your misguided One True JSON Implementation goal.

Re:Java 9 features announced by karianna on Tuesday August 19, 2014 @11:13AM (#8197720)
That's a Java EE API. I've been working with the Java SE and Java EE folks to make sure that a new version of that will sit on top of the core JDK 9 one.
Re:Java 9 features announced by mdaniel on Wednesday August 20, 2014 @11:12PM (#8205773)
How did you arrive at the conclusion that a set of interfaces is a JavaEE API?

Above and beyond the fact that in section 2.2 of the JSR it plainly states: "This JSR is targeted for Java SE 6 or higher and Java EE 7 or higher platforms."

Re:Java 9 features announced by karianna on Thursday August 21, 2014 @05:50AM (#8206584)
We helped test out the RI and TCK - it was in the end up built for Java EE in mind (that's not to say someone couldn't provide a stripped down version that could work for SE - but I don't think anyone has or will).
Re:Java 9 features announced by jug6ernaut on Monday August 18, 2014 @01:54PM (#8193669)
Im not sure i would call having multiple options a huge sore point. Chances are many of these options would still exist even if there was an official API.

FYI: Just looked at your nanojson, looks good. Might have to try it out, i like the fluent api for object creation.

Re:Java 9 features announced by th3iedkid on Monday August 18, 2014 @02:00PM (#8193693)
>>Im not sure i would call having multiple options a huge sore point

It becomes one when serializing and de-serializing across a distributed application like xerces class path issues in different jvm implementations.Not a common sore point though!

>> Chances are many of these options would still exist even if there was an official API.

True and agreed.

Re:Java 9 features announced by timmclean on Monday August 18, 2014 @05:49PM (#8194912)
Gson worked perfectly for me a few years ago. Why did you end up implementing your own?
Re:Java 9 features announced by jgalt212 on Monday August 18, 2014 @08:59PM (#8195543)
Amen to that, brother. JSON is a huge pain point for Java. No wonder so many Java folks keep defending XML--at least it's malleable in their home language.