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.
  • There isn't actually a problem in the interaction of methods and pod, when you consider that the "problem" is based on false assumptions.

    One false assumption is that methods have to be indented when you have a block class in order to be pretty; I disagree, and methods can be flush left just like their pod, so all pretty so far.

    Another false assumption is that you can't have block classes in Perl 5, and so what worked for Perl 5 can't work for Perl 6; in fact you *can* have block classes in Perl 5, and I hav

    • There isn't actually a problem in the interaction of methods and pod, when you consider that the "problem" is based on false assumptions.

      One false assumption is that methods have to be indented when you have a block class in order to be pretty; I disagree, and methods can be flush left just like their pod, so all pretty so far.

      I had this discussion with Tene yesterday after writing the blog post. He said the same thing [perlgeek.de].

      I think I started to value indenting everything many years ago, when I wrote my first medium-sized application (in BASIC) without indentation, and got into a situation when I had to find a missing 'END' somewhere. Everything I've been doing since then has reinforced the idea that consistently indenting things is a really, really good thing.

      But you're right: making an exception in this case would solve the whole thing. I guess I'll have to try it out a few times and see if I can make an exception to my hard-line indentation policy.

      Another false assumption is that you can't have block classes in Perl 5, and so what worked for Perl 5 can't work for Perl 6; in fact you *can* have block classes in Perl 5, and I have been doing so for years in my newer CPAN modules.

      That's good news. I've actually seen this habit in people's Perl 5 code, but haven't thought of it as the block form, even though it effectively is.

      Note that, due to the weird rules surrounding the statement form, the same syntax wouldn't work in Perl 6 for more than one class per file. But then again, the block form fills the same purpose, so there's no need to use the statement form for this.

      And if one follows a practice of putting visual lines between routine declarations to make them easier to read by deliniating where routines begin and end, one can also put them before the first and after the last method.

      De gustibus non est dusputandum, but those visual lines look very intrusive to me. I tend to prefer to use comments to introduce explanations into my code, not visual lines. I see their use for tricking the brain into not being bothered by the lack of indentation, though. In my own code, I think I'll make do without them.