From: Ahem A Rivet's Shot on
On 17 Mar 2010 18:58:00 GMT
scott(a)slp53.sl.home (Scott Lurndal) wrote:

> Eric Chomko <pne.chomko(a)comcast.net> writes:
> >On Mar 17, 9:33=A0am, Ahem A Rivet's Shot <ste...(a)eircom.net> 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
> >>
> >> > > =A0 =A0 x =A0/* The variable x */
> >> > > =A0 =A0 =3D =A0/* is assigned */
> >> > > =A0 =A0 x =A0/* its value * /
> >> > > =A0 =A0 + =A0/* plus * /
> >> > > =A0 =A0 2 =A0/* one */
> >> > > =A0 =A0 ; =A0 /* . */
> >>
> >> > And would make all tapes spill over to two magtapes.
> >>
> >> > Fortunately, your code would produce many detected errors.
> >>
> >> =A0 =A0 =A0 =A0 Nope that's perfectly valid C code - provided that x
> >> is d=
> >eclared in
> >> scope.
> >>
> >
> >Isn't "in scope" redundant here? I mean scope only applies to binding
> >time, no? Locals vs. globals vs. non-locals which are not global,
> >etc. But I agree the code is fine from the stand point of the
> >compiler.
>
> except for the two occurances of '* /' instead of '*/'.

They don't stop it from being fine from the point of view of the
compiler - they just add another dimension of the comments being wrong.

--
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: jmfbahciv on
Jonathan de Boyne Pollard wrote:
>>
>>>>
>>>> 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.
>
<grin> My language is MACRO-10. JMF was always tickled whenever he
assembled some code because MACRO would report a "successful"
assembly with the comment "No errors detected". Think about it. ;-)

/BAH
From: jmfbahciv on
Nick Keighley wrote:
> 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
>
>
Before you do that, finding out the intent of the code is
valuable.

/BAH
From: jmfbahciv on
spinoza1111 wrote:
> On Mar 17, 2:13 am, 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:


<snip>
>>> Such edicts make one want to write code in the form
>>> x /* The variable x */
>>> = /* is assigned */
>>> x /* its value * /
>>> + /* plus * /
>>> 2 /* two */
>>> ; /* . */
>
> Nothing wrong with this style of commenting in assembler, at all. And,
> this code sample looks like the one byte per instruction language
> Mouse.

<snip>

Are you nuts?

/BAH
From: Bradley K. Sherman on
In article <IU.D20100316.T165150.P1185.Q0(a)J.de.Boyne.Pollard.localhost>,
Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups(a)NTLWorld.COM> wrote:
>> ...
>Such edicts make one want to write code in the form
>
> x /* The variable x */
> = /* is assigned */
> x /* its value * /
> + /* plus * /
> 2 /* one */
> ; /* . */
>

That's great for those new AI compilers that throw away
the code and compile the comments.

--bks

p.s. Yes, stolen from Stan Kelly-Bootle.

First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Prev: System Calls
Next: Warning to newbies