From: "Wiggins d Anconia" <[EMAIL PROTECTED]>
> I like most of this answer. I would add that you should drop the
> declarations of the subs, they are unneeded in Perl and can break some
> "features".  This will help to some extent depending on your calling
> order.  

???

1. The declarations are and are not unneeded. Try to remove the 
declaration from this piece of code:

        sub foo;

        foo 1, 2, 3;

        sub foo {
                print "called foo(" . join(', ', @_) . ")\n";
        }

Until you either declare or define a subroutine you have to put 
braces around its parameters to convince Perl that there will someday 
be a subroutine with that name.

2. What features do you mean? Noone's talking about prototypes here!

> For the most part I think alphabetical is silly, unless it *also*
> makes logical sense. I would say if you need alphabetical order to
> remember where things are then you need a better editor that lets you
> search faster, and alternatively provides code folding.  Certainly in
> OOP, I prefer to keep my class and constructors towards the top, I
> would hate to have 'new' 3/4 of the way down, and have
> _init,init,_initialize (whatever) above it...

Agreed. For me it's something like
        main code first
        higher level functions then, grouped logicaly
        "tool" functions last
for OO modules it's new() first followed by init() (if any) followed 
by the methods in approximately the order they would be used.
Or not. I don't think I'm too consistent in this.
 
Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to