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

Ratio behind indenting of the Perl source

Thread Next
Tassilo von Parseval
May 12, 2003 02:50
Ratio behind indenting of the Perl source
Message ID:

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.


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About