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

use Perl Log In

Log In

[ Create a new account ]

ferreira (5993)

ferreira
  (email not shown publicly)
http://www.ferreira.triang.net/

Just another Brazilian Perl hacker.

Journal of ferreira (5993)

Wednesday April 30, 2008
09:50 PM

Is your file tidy? Really?

[ #36295 ]

With respect to Perl::Tidy, it is quite obvious that a tidy file is one that has gone through perltidy and which does not change if reformatted again.

$ perltidy tidy_file.pl
$ diff tidy_file.pl tidy_file.pl.tdy
# zero, no difference

But Perl::Tidy is a work in progress which is constantly improving. And improving means changing. Those changes may include the fixes of some behaviors considered non-ideal or even flawed. So tidy files under a Perl::Tidy version may not be tidy under another version. So this concept is a little fragile (or needs a more precise wording).

Even Test::PerlTidy (which intends to capture that tidy-ness concept in the form of an automated test) was caught by this detail, since a new release of Perl::Tidy got out. Edmund von der Burg and me are working on a reasonable approach to this issue. Wait for a new release of Test-PerlTidy soon.

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'm convinced that there is no "right" solution to this problem. Perl::Critic has the same issues, as does the CPANTS Kwalitee game. Coverity, FindBugs, PMD and CodePro all have the same issues in the Java world. Even the Acid3 browser test had this problem -- IIRC Safari (or was it Opera?) got 100% compliance, but then someone found a bug in the test and Safari lost their 100%.

    Any test where you can achieve a perfect score on a subjective metric is destined to cause "not my fault" failures in the future
  • Evaluating the human readability of code (i.e. its aesthetics) by how close it is to some machine-generated format is just wrong.
    • I also believe that claiming a tidy file (as per Perl::Tidy) is more human readable is a too presumptuous statement. Sometimes perltidy bugs me too because I cannot make it fit exactly with my mental model of desirable code layout. But one thing it achieves: an automatic/objective way to determine a layout, cleaning gratuitous difference on code styles and fixing details like: avoiding tabs, enforcing cuddled elses everywhere, etc. And this is a good thing for large codebases, meant to be worked out by man