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
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Yes (Score:2)
And if I understand what you're saying, I do the same thing.
Re:No (Score:1)
Hi Folks
Alphabetical order here.
And with a comment on the sub's closing } to re-iterate the name, as in:
} # End of marine.
Read order (Score:1)
Because I interleave my method POD in between the methods, I usually order them in human-learning order.
Constructor
Accessors
Main Methods
Support Methods
Re: (Score:1)
I do almost the same. I love having my POD right next to the methods so it's easier to update when I update the method. So my documentation usually prescribes my method order which usually works out to be the best way to orgainze them, at least for me.
I used to (Score:1)
But as time goes by I get less inclined to. POD gets written down after the
__END__and the module gets written up in learning order, but in the body of the code, stuff falls where it will (usually near to where it got extracted from) and etags claims its own.If I'm coding in Ruby, it goes 'public, protected, private' (and when I do sort perl methods, that's the kind of gradient I go with as well, even though perl doesn't make those distinctions.)
Re: (Score:1)
PS -- Thanks to use.perl's craptastic version of "HTML formatted," which doesn't allow PRE or some equivalent, the only way to post code seems to be to post the whole thing as "Code."
(* with some help)
(defun my-imenu-fixup (list)
(mapcan (lambda (x) (if (consp (cdr x)) (my-imenu-fixup (cdr x)) (list x)))
list))
(defun uniquify (list)
(let ((h (ma
Re: (Score:1)
... or >ecode<
Re: (Score:1)
script versus module (Score:0)
I do that in "scripts", basically write what I want to happen, then fill in the details. I usually put a
mainfunction at the top too, as the entry point, followed byexitjust to be explicit about what's happening (to indicate that there's no "inline" code between subroutine definitions).In modules, I'd tend to use the "learning-order" that people mentioned.