On Apr 6 2007 10:29, David Brownell wrote:
Well, I did not consider that "space" to be indent, as in:
if($previous_line_was_an_if)
($indent, $padding) = (/^(\t+)(\x20{2,})/);
I do not want to argue about that now, though.
>And CodingStyle says that line 2 should have "substantially more" indent...
If the condition becomes so complex that it's "too complex", it should
be split up into multiple ifs, or even functions,
>So not just "more" indent, but "substantially more". (Although one
You disagree. "We", as in, the kernel coders, though I do not speak for
them, seem to do it much the way I described, judging from the code they
wrote/write.
Please see the referenced perl script [1] that heuristically tries to figure
out the number of space-continued (SC) vs. tab-continued (TC) lines (L)
following an if (IF) statement.
linux-2.6.21-rc6$ find . -type f -iname '*.[ch]' -print0 | \
xargs -0 cat | ./findcont
L:7227630 IF:352877 NOCONT:309465 SC:30395 TC:8689 ##
NOCONT: 87.7% SC:8.6% TC:2.5%
(Does not quite add up to 100%, but I'll let someone
else figure that out.)
Jan
====
[1] https://svn.ahn.hopto.org/hxtools/trunk/supp/findcont
-
| Linus Torvalds | Linux 2.6.27-rc5 |
| Greg KH | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg Kroah-Hartman | [PATCH 004/196] Chinese: add translation of SubmittingPatches |
| Trent Piepho | Re: [PATCH] [POWERPC] Improve (in|out)_beXX() asm code |
git: | |
| Christoph Hellwig | Re: [PATCH 06/32] IGET: Mark iget() and read_inode() as being obsolete [try #2] |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
