Working on a Java and Scala code-base, there's a debate about whether to use Java's Jackson JSON or the Play Framework's JSON Library.
After reading the Play JSON Docs, as well as Chapter 9 (JSON) of Play for Scala, I also ran through an example from Mykong on Jackson.
Based on looking at a few simple examples, Play's JSON Library seems like the superior choice due to, overall, its Functional Programming Approach:
- Providing compile-time safety when parsing JSON with Option/JsResult data types.
- As a result of the above, higher order functions (map/flatMap) are available and provide power and succintness
- As I understand, Jackson parses via the typical try/catch paradigm. Dealing with JSON errors at compile-time(Play) v. run-time(Jackson) is a no brainer
Bottom line - Play's JSON library uses a functional programming approach that results in code that is easier to reason about than the Jackson library.
Overall, the choice seems clear to me. Am I missing any pros/cons for either library?