makamaka / JSON

perl implementation of JSON encoder/decoder
42 stars 40 forks source link

Please DO NOT CHANGE DEFAULT VALUES #39

Closed karenetheridge closed 5 years ago

karenetheridge commented 5 years ago

As expressed on irc, the entire point of a wrapper around the various backends is to provide a consistent experience no matter which backend + version the user has installed. To change the default behaviour now would break some applications and defeats the entire purpose.

Please, I implore you, remove this release on cpan.

see also https://github.com/makamaka/JSON-PP/issues/40

cc @charsbar

charsbar commented 5 years ago

As you said, the entire point of a wrapper (JSON.pm) around the various backends (JSON::XS and JSON::PP) is to provide a consistent experience no matter which backend + version the user has installed. And now JSON::XS has changed, JSON::PP needs to change to provide a consistent experience for JSON users.

JSON and JSON::XS (and later JSON::PP) all have much longer history than JSON::MaybeXS or Cpanel::JSON::XS. The maintainers of JSON/JSON::PP and JSON::XS have all agreed to get along with each other and keep our modules as compatible as possible. After an unfortunate period, both JSON and JSON::XS have been (kind of) forked, and some people have been trying to split the community, but still JSON has 1500~1700 users, while JSON::MaybeXS has ~400. Both are not small, but which should have precedence?

I understand your sentiment. To be honest I myself was surprised at the change. However, let's face the fact that the spec we sticked to has already been obsoleted for more than five years (since 2013). There were tickets to ask us to comform to the latest spec(s), and Marc must have been asked to do so, too (otherwise he wouldn't have written the section about the old vs new JSON specs). The only reason why I didn't listen to the requests was JSON::XS refused to do so. And now JSON::XS has changed its policy and decided to conform to the latest spec, why JSON/JSON::PP need to stick to the obsolete one, especially when the new behavior is just to allow more values? Post-RFC7158 modules like Mojo::JSON/JSON::Tiny have already accepted nonref values. The change, though it's certainly backward incompatible, is just to let JSON/JSON::PP/JSON::XS do the same.

Certainly this change has unfavorable side effects if you use the "incremental" parser of JSON backends. Some tests that have ignored the fact that the spec has changed may fail, and applications that have expected decode_json only returns a reference may break at a different point, and there may be more issues. Still, IMO, what you should do is not ask us to remove the latest JSON::PP, but ask Reini to change his fork, or maybe fork JSON::PP for your wrappers and keep them all dead.