Wednesday July 11, 2007
Shut up about my Perl formatting
Inspired by Ovid, would people please shut about about the way I lay out Perl code?
Yes dammit, I use tabs for indenting. I've copped repeated grief about this.
I use 8 space tabs, because I have slight "figure-ground" problem, I find it a little harder than you do to pick out features from a background. So I don't see indents properly at 2 spaces, and I find 4 spaces a little annoying as well, whereas 8 is comfortable for me.
But I don't impose my indenting on you, I use tabs so you can see them any way you want, at any depth you want.
And no, no I don't use them anywhere other than left-hand indenting, because obviously it breaks. Tabs that aren't at the left of the screen are BAD, so I don't use them
My code looks like how I prefer it, and it ALSO looks whatever depth YOU want it to be. So when you have your editor set up to arbitrarily take my tabs and "clean it up" replacing the tabs with spaces, it's breaking my layout by making it conform with YOUR layout, and nobody elses.
On a related note, to gripe in the other direction, can I just say something about contributing to other people's code.
The maintainer of a CPAN module is the one that decides the structure and layout and rules. If you are contributing to somebody else's project, please try to follow their layout. If they use space indenting and 2 space, do the same.
If they use Perl::Critic and scatter # no critic entries through the code, try to follow the same if you can.
Now, god knows I totally appreciate people contributing to my modules.
But if you do PLEASE don't use Perl 5.8 expressions when the module is clearly labelled with "use 5.005 or use 5.006", "upgrade" my code to conform with Perl::Critic (apparending the rule set to the bottom of my POD) or run my code through a Perl pretty-printer with Perl Best Practices recommended settings.
Because I'm probably going to have to revert your changes, or waste a bunch of time going through and "fixing" all the changes you made.