Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I've had to fix enough code where the original programmer's intent wasn't clear, or is lost in the mists of time.

    In the absence of some explicit documentation that says the example function doesn't return anything, the change you show seems reasonable.

    And if you have explicit documentation that says the example function doesn't return anything, the change also seems reasonable -- it guarantees that someone using your interface can't ignore the documentation, depend on undocumented functionality, and force y
    • Well, first of all, there *were* explicit docs that said that text was returned.

      Beyond that, though, this change caused the entire module to become completely useless, which means that it wasn't desk checked. Why not? Because the module wasn't undergoing any actual maintenance. In the course of other work, someone saw Perl::Critic complain about "no explicit return" and added one, without further testing.

      Sure, automated testing would've caught this, but if there are no automated tests, you don't make changes without desk checking them. More importantly, if the code is working, you don't change it without a reason.

      Maybe "improve maintainability" is a reason for some changes, but not until there are tests to ensure that your changes don't, you know, break the program.
      --
      rjbs