JSON-Create reviews


RSS | Module Info | Add a review of JSON-Create

JSON-Create (0.19) ****

Review for 0.02: Performance-wise, still has some catching up to do against JSON::XS & Cpanel::JSON::XS with regards to encoding arrays & hashes.

UPDATE review for 0.19: Giving it 4 stars now. Speed has been improving and on-par/slightly better than the other JSON XS modules in some areas, while a bit worse in some other areas. Faster modules are always welcome.

JSON-Create (0.20) *

We already have a million JSON modules, and I can appreciate someone's alternative take on the problem, but JSON::Create poorly solves only half of it, at the price of a full module, without any added benefit or originality. You can only encode Perl data structures to JSON—something pretty much all other JSON modules can already do. If you want to decode, you need another module.

Considering the module has author's own JSON::Parse in prereqs, I don't see why the author could not simply add the 'create_json' subroutine to JSON::Parse.

Even the author's own comments suggest there's no reasonable rationalle for this module's existence. From the HISTORY section of the documentation: "I started making this module so that, with this and JSON::Parse, I wouldn't have to ever use any of the existing JSON modules on CPAN ever again." A bizarre and baseless desire.

The author is passive-aggressive about the critique they received on this module and advises to "calm down" when bugs in the module are reported on the official bug tracker. After a discussion on GitHub, the author actually deleted and edited all the comments by contributors and then closed the Issues. They also post deliberately skewed benchmarks, appear to be down-voting all the negative reviews using multiple accounts, and post snarky reviews of other JSON modules.

They even went as far as package a "response" file to this review in their distribution claiming "harassment" that never happened and "early release" comments when this review clearly demarcates the module version it's for: metacpan.org/pod/distribution/JSON-Cr...

Looking further at technical aspects:
*) The module offers just a single subroutine, yet you have to explicitly request its export.
*) Unlike many other JSON modules on CPAN, JSON::Create does not handle objects that implement ->TO_JSON method and instead the base datatype is used (e.g. bless [qw/foo bar baz/], "foo" ends up encoded as ["foo", "bar", "baz"]). BUT, that conversion happens inconsistently: e.g. the module dies if you try to encode Mojo::URL, despite that object's overloading stringification.
*) Speaking of objects, JSON::Create dies if you feed it JSON::XS::Boolean or similar objects that special-handle conversion between Perl and JSON booleans
*) Be sure to sanitize your data for any subrefs. JSON::Create dies if it encounters them.
*) There's no handling for globs either and instead of doing something sensible (e.g. "null"), the module encodes them as "*Symbol::GEN0" or similar.

In summation, this module does not offer any original solution and seems to be a partial reimplementation of the things already available on CPAN. The author is hostile and does not welcome suggestions for improvement. Avoid this module at all costs.
1 hidden unhelpful review