develooper Front page | perl.perl5.porters | Postings from May 2003

Ratio behind indenting of the Perl source

Thread Next
From:
Tassilo von Parseval
Date:
May 12, 2003 02:50
Subject:
Ratio behind indenting of the Perl source
Message ID:
20030512093233.GA1159@ethan
Hi,

does anyone have any insight into the sometimes quite idiosyncratic
indenting and formatting of the code found in the Perl source-tree? I am
again trying to mangle in a patch into h2xs to make it understand enums.
This even seems to work but I haven't been able to get a deeper
understanding for the interrelation of some of the command-line
switches on the source-level. The code is extremely nested which makes a
proper indenting even more necessary. But instead it all looks pretty
arbitrary to me...some blocks indented, some not, some even outdented etc.

Thus I conclude that there is no real convention on how to format code.
h2xs is only one of many pathological cases and before I add another
feature that will make the script yet harder to understand, I am
playing with the idea to submit a few indent-only patches. Once such a
clean-up has been done, further modifications will be easier because the
existing codebase is more friendly on the eye. Right now, h2xs for
instance looks almost unpatchable for me (also, the comments are often
next to useless).

What is the general opinion on that? Perhaps the group could even agree
on a few essential guide-lines as to formatting code. I mainly have the
pure-Perl bits of the source in mind though similar agreements could be
made for the C-stuff, too. But this part of the code looks more tidy.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


Thread Next


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