develooper Front page | perl.perl6.internals | Postings from August 2001

Re: Final draft: Conventions and Guidelines for Perl Source Code

From:
Nicholas Clark
Date:
August 15, 2001 04:15
Subject:
Re: Final draft: Conventions and Guidelines for Perl Source Code
Message ID:
20010815121545.J46331@plum.flirble.org
On Wed, Aug 15, 2001 at 11:28:20AM +0100, Dave Mitchell wrote:
> The one thing I'm not sure about is whether we should mandate where the
> comments go.  For example, I personally Iike comments before the
> conditional describing the condition, and/or comments after describing
> the action:
> 
> /* stack full ? */
> if (ix > max_ix) {
>     /* allocate more */
>     ....
> }
> else {
>     /* push the thinggy */
>     ....
> }
> 
> So, do we mandate or not, and if yes, what style?

This style of placing comments seems to be logical and consistent.
Maybe it would be better to "advise" rather than "mandate" the style?
Can we generalise it to "comments should appear on the line(s)immediately
above the code that they are describing"?

Nicholas Clark



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About