Subj : Re: Syntax, style, the infinite monkey theorum and coding To : comp.programming From : Rob Thorpe Date : Mon Aug 22 2005 10:52 am Gerry Quinn wrote: > In article <1124699428.796351.185650@g14g2000cwa.googlegroups.com>, > gswork@mailcity.com says... > > Ed Prochak wrote: > > > gsw...@mailcity.com wrote: > > > > how about a C program with a seven page while() loop where the > > > condition on the while() loop was seven full lines long (where full > > > means about 70characters per line, not counting whitespace)? Sorry I > > > don't have the code available. That was at a job nearly twenty years > > > ago. It was written by a contractor that the company respected and was > > > considered a great programmer. Needless to say I did not share that > > > opinion when I was assigned to maintain and debug this beast. > > > > I like the idea that a condition can be seven lines long! Now that's a > > condition! > > I can imagine that being a viable style in some cases, i.e. where there > are several independent conditions that break the loop and each needs a > comment: > > while( condition1 // comment > && condition2 // comment > && condition3 // comment > ) > { > // do stuff > } Yeah, I've seen code like this that is perfectly understandable. The conditions to break-out of doing something complex can be quite complex. It can be done in a nicer way, but this way isn't properly nasty. > It's the multi-page block that seems more problematic. Absolutely. .