Subj : Re: Syntax, style, the infinite monkey theorum and coding To : comp.programming From : Mike Date : Tue Aug 23 2005 12:23 pm In article , gerryq@DELETETHISindigo.ie says... > 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 > } > > It's the multi-page block that seems more problematic. > > - Gerry Quinn > My preferred style would be something like... function Peculiar_Conditions(some arguements) : boolean; begin result := condition1 //comment and condition2 //comment and condition3; //comment end; .... while Peculiar_Conditions(some arguements) do begin do stuff end; Thus separating out the conditional logic from the rest of the program flow. Mike .