Re: Repetitive XML comments -- what's the point?
"Noah Sham" <noahsham@veriz on.netwrote in message
news:OaZco7I7GH A.1560@TK2MSFTN GP04.phx.gbl...
I would say that 1 should be a parameter to a function/method and the name
of that function/method would do a lot to obviate the comment. 3 should be
replaced by (sizeof ptPoints / sizeof *ptPoints). As for the two pixels, yer
right - that comment may be correct, but it's a little confusing (maybe the
line is two pixels from the interior of rcRect?).
It takes a brave man to post code here. :)
"Noah Sham" <noahsham@veriz on.netwrote in message
news:OaZco7I7GH A.1560@TK2MSFTN GP04.phx.gbl...
>1 and 3 also smell like magic numbers that should be named constant. Also,
>where are the two pixels referenced in the comment ? :')
>where are the two pixels referenced in the comment ? :')
of that function/method would do a lot to obviate the comment. 3 should be
replaced by (sizeof ptPoints / sizeof *ptPoints). As for the two pixels, yer
right - that comment may be correct, but it's a little confusing (maybe the
line is two pixels from the interior of rcRect?).
It takes a brave man to post code here. :)
>"Ben Newsam" <ben.newsam@uko nline.co.ukwrot e in message
>news:6dqli2hq4 835r4icu52dneua msprauc6us@4ax. com...
>news:6dqli2hq4 835r4icu52dneua msprauc6us@4ax. com...
>>>
>>// Up the left side and across the top,
>>// two pixels away from the window.
>> hPen = CreatePen ( PS_SOLID, 0, bRaised ? WHITE : BLACK );
>>hOldPen = SelectObject ( hDC, hPen );
>>ptPoints[0].x = rcRect.left - 1;
>>ptPoints[0].y = rcRect.bottom;
>>ptPoints[1].x = rcRect.left - 1;
>>ptPoints[1].y = rcRect.top - 1;
>>ptPoints[2].x = rcRect.right;
>>ptPoints[2].y = rcRect.top - 1;
>>Polyline ( hDC, ptPoints, 3 );
>>SelectObjec t( hDC, hOldPen );
>>DeleteObjec t( hPen );
>>// Up the left side and across the top,
>>// two pixels away from the window.
>> hPen = CreatePen ( PS_SOLID, 0, bRaised ? WHITE : BLACK );
>>hOldPen = SelectObject ( hDC, hPen );
>>ptPoints[0].x = rcRect.left - 1;
>>ptPoints[0].y = rcRect.bottom;
>>ptPoints[1].x = rcRect.left - 1;
>>ptPoints[1].y = rcRect.top - 1;
>>ptPoints[2].x = rcRect.right;
>>ptPoints[2].y = rcRect.top - 1;
>>Polyline ( hDC, ptPoints, 3 );
>>SelectObjec t( hDC, hOldPen );
>>DeleteObjec t( hPen );
Comment