| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On 8/28/03 10:45 AM, M. Uli Kusterer didst favor us with:
At 10:23 Uhr -0400 28.08.2003, Laurence Harris wrote:By this logic, programmers should be the best people to write user guides.
;-)
No! You're turning my words in my mouth.
As soon as I figure out what that means in English I'll come back with a
crushing reply. ;-)
For example, one could replace all this stuff we've been using in our
example with function named:
SizeControlToFillWindowLeavingSpaceForHorizScrollbar( control, window );
This would not only eliminate the need for a comment IMO, but it would
condense the code considerably in a good way by eliminating the clutter
created be the local variables.
const SInt16 windowWidth = intRight - intLeft,
windowHeight = intBottom - intTop,
kScrollbarWidth = 15;
SizeControl( control, windowWidth, windowHeight - kScrollbarWidth );
In fact, if you use enough of these kinds of functions the logic of your
code can become extremely easy to follow just from reading a sequence of
well-named functions:
CreateWidgetWindow( &widgetWindow );
CreateWidgetControlToDisplayContent( widgetWindow , &widgetControl );
SizeControlToFillWindowLeavingSpaceForHorizScrollbar( widgetControl,
widgetWindow );
CreateHorizontolScrollbarAtBottomOfWindow( widgetWindow, &scrollbar );
| References: | |
| >Re: [OT] Commenting source code (was Re: Problems with Controls Manager) (From: Laurence Harris <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.