Linus Torvalds wrote:I care, yes. I've found my code looks much prettier, with attendant improvement in ease of understanding, since I stopped being so anal about 80 columns. The width of the code, that is first to last non-blank on each line, is about the same, not because I work to keep it narrow, but because most statements just are narrow. Sometimes I do get really wide statements, for example when using deep data structures, especially as parameters in procedure calls, and this is easier to read than having to break the line. I honestly think the reason we used to insist on lines less than 80 characters was because on an 80 character screen, you get slightly better readability by choosing where to break each line than simply letting the hardware do it. We don't have the physical limit any more, so we don't need to impose it structurally. It's about readability, and with due respect, people who've never tried it aren't qualified to comment. What's too deep? Is the following too deep? It's common enough, other than my refusal to relax consistent indenting style for switch bodies. The code is readable, and breaking it into multiple procedures just to de-indent is often impossible, and rarely readable. With a strict 80 character limit, the meat in the sandwich is left with only 20 or so characters in which to fit. Add a nested switch, and there's virtually no space left for code. 123456789012345678901234567890123456789012345678901234567890123456 (70) int procedure(param list) { switch (condition) { case value: if (another_condition) { if (variant) meat_in_sandwich; } else { code; } case value2: switch (sub_condition) { case sub_value: if (final_test) { something( NULL, 1, "two"); } } } } (Yes, I know, "we don't indent 'case' because it consumes too much room." That's inconsistent with the rest of normal indenting style, and a poor excuse to keep within an obsolete and unnecessary restriction.) --
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Linus Torvalds | Linux 2.6.27-rc5 |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| David Miller | Slow DOWN, please!!! |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Natalie Protasevich | [BUG] New Kernel Bugs |
