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.
  • Having this kind of discussion can easily become very unproductive and stupid if you just spew opinions.

    Well, this part of the post I agree with 100% :)

    At work, I've already told jplindstrom and others that I don't care what the source code formatting rules are, so long as they're consistent and automated. There's no way in hell I want to enforce them manually, but even if I don't like them, I'll follow them since most (reasonable) programmers have at least semi-coherent styles and when people start

    • Heh. I chose mine in part because I can cajole perltidy into spitting it out… alas, not entirely:

      1. I have a rule that a comma-separated list is either all on one line, or it gets bracketed/parenthesised and written one item per line. (Fat commas do not count.) Perltidy does not help with this.

      2. The other problem is not due to perltidy, but because I don’t know how to deal with it: line-wrapping.

        I have never found a satisfactory rule for how to break lines to hard-wrap them at a specific column. I find that no matter how it is done, readability always suffers unacceptably. It’s much worse if unwrapped code gets line-wrapped dumbly by the editor, of course. So I turn line-wrapping off (:set nowrap), and I do occasionally let my lines run past 80 columns. But I do my best to avoid this manually, by measures such as factoring subexpressions into temporaries and the like.

        Funnily enough, even though that’s not something a pretty-printer will ever be able to do in my stead, simply telling it to never wrap lines works just fine for code that was written with this expectation.

      Other than those (and a few niggly cases so rare that I can’t think of them off hand), my style is exactly what perltidy will produce with the appropriate settings.

      • Your comma separated list reminded me that I have stuff [perl.org] to make that easier to reformat. Well, I see you use Vim, but maybe someone else will find it useful.