"be consistent" | |
PerlMonks |
Re^2: Minor API changes in 10-year-old moduleby wanna_code_perl (Friar) |
on Sep 05, 2019 at 18:52 UTC ( [id://11105680]=note: print w/replies, xml ) | Need Help?? |
The API changes I've made are deliberate, and ultimately for the good of the project. As an example of why I made these changes, there was a method that would:
Since returning non-zero had no semantic meaning beyond "nothing broke," and the distinction between return 0; v. croak() was already ill-defined, I changed this sub to always croak() on error, thinking most implementations would already be eval{...}-ing that call, or risk premature death. That's the biggest change. The other 3-4 examples are similar but simpler (fewer cases). The documentation for the methods was generally good, except when it came to error handling. So I'm not really even going against the existing documentation, here, though I'm not using that as an excuse to break people's code. :-) BTW, I think it's ok if you name the module, that might help, it's all open source anyway :-) My personal choice. I'm not naming the module out of respect for the original author. I have not been able to reach them, and don't want them to hear about my feedback via this thread. I trust I've described the differences well enough for the general advice I'm asking for. (If not, please let me know!)
In Section
Seekers of Perl Wisdom
|
|