Joerg Schilling wrote: > Casper.Dik at Sun.COM wrote: > > >> They're the OpenSolaris rules we took from Solaris. >> >> And they are, IMHO, still valid rules; 132 character lines do not add >> anything; rather, they annoyingly waste 40% of screen real estate. >> >> Why do you think newspapers are set in colums? Because we can't read or >> follow long lines very well. >> >> 80 characters are a good compromise. >> >> Changing to 132 requires *everyone* to change their habits; it limits the >> > > I use the following rule: > > Try to be able to deal with 80 columns but make a hard limit at 132. > Note that even 132 cannot be always the limit as I write portable softwar that > compiles on HP-UX using the free compiler that comes with HP-UX. This compiler > cannot do string concatenation.... >
In that case it seems like you have a justification for going beyond 80 chars. Although, does the compiler support constructs like this: "The first part of the line\ the second part of the line" (Backslash quoting.) I contend that in nearly 100% of the remaining cases I've seen, the code that extends past 80 columns is poorly structured. For example, its often possible to restructure using functions, or reversing the sense of one or more of the tests in an if {} block. After about three levels of nesting, it becomes hard to follow code flow, so I usually try to make a practice of not allowing my code to get too deeply nested. The nice thing about the 80 column limit is that it acts as a natural guard against this. When I find that my code is getting squished up into the right columns, that's usually when I know that I need to step back and take a look at the larger structure, and look for cleaner, simpler ways to express what I'm coding. The other thing is that there are a *lot* of us that still use 80 column editors. emacs comes up by default in 80 column mode. So do most terminal emulators (xterm, dtterm, etc.) Breaking that 80 column rule will cause a lot of grief for a lot more people... and I think it is a bad idea. -- Garrett > > J?rg > >