[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Svn book and sample Perl code style

From: Ben Reser <ben_at_reser.org>
Date: 2003-12-05 04:13:25 CET

On Tue, Dec 02, 2003 at 07:43:48PM +0100, Jostein Chr. Andersen wrote:
> As mentioned a cople of times here: There's no such thing as default code
> style for Perl. In fact, the Perl slogan is "It's more than one way to
> do it!"

There's no such thing as a default code style in *ANY* language. But
there are various norms for what people expect in the code. GNU style
is most definately not the norm in perl code.

> It's many C developers here, so I recommend that a GNU/C stylish as in
> packages/win32-innosetup/tools/*.pl. That way, many peope will
> understand the code and even be able to fix stuff inside it.

Example code isn't for C developers. It's for end users and Perl
developers. Fact is that code isn't really following the same style
anyway. If it was all functions would be using parens and you wouldn't
see things like "chomp $new_start;" and "$new_start = <LASTDUMPED>;"

IMHO applying a code style designed for one language doesn't make much
sense. Given that there isn't a ton of Perl code in subversion or its
manual I'd go with the norm for Perl. Plus, if you're going to use
Perl, you're going to end up using idioms that don't have clear
guidelines for use under the GNU coding style.

> If a Perl program are longer than 20 lines, then everything should be in
> sub routines (no sequenctial program flow),
> The most cryptic Perl short cuts should be avoided. Even a Perl
> programmer will have problems to understand the code if he's away from
> perl more two months.

Can't say I disagree with that. Especially in example code. But I
don't think that's a problem looking at the code.

-- 
Ben Reser <ben@reser.org>
http://ben.reser.org
"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Dec 5 04:13:57 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.