Prev: System Calls
Next: Warning to newbies
From: Robert Marshall on 17 Mar 2010 08:11 On Tue, 16 Mar 2010, Kenny McCormack wrote: > In article > <IU.D20100316.T165150.P1185.Q0(a)J.de.Boyne.Pollard.localhost>, > Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups(a)NTLWorld.COM> wrote: >>> >>>> >>>> If an obscure technique is being employed, then a comment to that >>>> effect is a helpful pointer but I have seen _REALLY USEFUL_ >>>> comments along the following lines ... >>>> >>>> x := X + 1 ; increment x > > A true CLC pedantic would point out that the above does not increment > x (unless x and X have the same value). > and would also point out that the comment should read 'increment x by 1' (so if X >= x it still increments x unless we start having integer overflow) Robert -- La grenouille songe..dans son château d'eau
From: Jonathan de Boyne Pollard on 17 Mar 2010 08:58 > >>> >>> In our shop, those appeared when we got the idiotic edict that each >>> line had to have a comment. >>> >> Such edicts make one want to write code in the form >> >> x /* The variable x */ >> = /* is assigned */ >> x /* its value * / >> + /* plus * / >> 2 /* one */ >> ; /* . */ >> > And would make all tapes spill over to two magtapes. > > Fortunately, your code would produce many detected errors. > You might think that, but the reality appears to be that that is untrue.
From: Nick Keighley on 17 Mar 2010 09:14 On 17 Mar, 12:07, jmfbahciv <jmfbahciv(a)aol> wrote: > Nick Keighley wrote: > > On 16 Mar, 18:13, gaze...(a)shell.xmission.com (Kenny McCormack) wrote: > >> In article <IU.D20100316.T165150.P1185...(a)J.de.Boyne.Pollard.localhost>, > >> Jonathan de Boyne Pollard <J.deBoynePollard-newsgro...(a)NTLWorld.COM> wrote: > > >>>>> If an obscure technique is being employed, then a comment to that > >>>>> effect is a helpful pointer but I have seen _REALLY USEFUL_ comments > >>>>> along the following lines ... > >>>>> x := X + 1 ; increment x > >> A true CLC pedantic would point out that the above does not increment x > >> (unless x and X have the same value). > > > it plainly isn't C. Perhaps in whatever-it-is-written-in cares about > > case. doh! ///doesn't care about case/// > > What *is* it written in? > > >>>>> ... which only serve to increase the noise floor. > >>>> In our shop, those appeared when we got the idiotic edict that each > >>>> line had to have a comment. > >>> Such edicts make one want to write code in the form > >>> x /* The variable x */ > >>> = /* is assigned */ > >>> x /* its value * / > >>> + /* plus * / > >>> 2 /* two */ > >>> ; /* . */ > >> Correction applied. HTH. > > > #include "crlzyzz.h" /* obvious meaning */ > > > if it's obvious, why did you comment it? > > Now that one may have usefulness :-). If it's not > obvious to the reader, then a search for the author > or his/her specs is in order. to beat him about the head and shoulders with
From: Ahem A Rivet's Shot on 17 Mar 2010 09:33 On Wed, 17 Mar 2010 07:03:43 -0500 jmfbahciv <jmfbahciv(a)aol> wrote: > Jonathan de Boyne Pollard wrote: > > Such edicts make one want to write code in the form > > > > x /* The variable x */ > > = /* is assigned */ > > x /* its value * / > > + /* plus * / > > 2 /* one */ > > ; /* . */ > > > And would make all tapes spill over to two magtapes. > > Fortunately, your code would produce many detected errors. Nope that's perfectly valid C code - provided that x is declared in scope. -- Steve O'Hara-Smith | Directable Mirror Arrays C:>WIN | A better way to focus the sun The computer obeys and wins. | licences available see You lose and Bill collects. | http://www.sohara.org/
From: Patricia Shanahan on 17 Mar 2010 10:14
Ahem A Rivet's Shot wrote: > On Wed, 17 Mar 2010 07:03:43 -0500 > jmfbahciv <jmfbahciv(a)aol> wrote: > >> Jonathan de Boyne Pollard wrote: > >>> Such edicts make one want to write code in the form >>> >>> x /* The variable x */ >>> = /* is assigned */ >>> x /* its value * / >>> + /* plus * / >>> 2 /* one */ >>> ; /* . */ >>> >> And would make all tapes spill over to two magtapes. >> >> Fortunately, your code would produce many detected errors. > > Nope that's perfectly valid C code - provided that x is declared in > scope. > This sort of thing is one of the strongest arguments for *always* editing and viewing code in an editor with syntax highlighting for the source language. The problem and the reason why the compiler would accept the code both become glaringly obvious. Patricia |