Re: Redeclaring overrides
Re: Redeclaring overrides
- Subject: Re: Redeclaring overrides
- From: Georg Tuparev <email@hidden>
- Date: Sun, 19 Aug 2001 13:57:51 +0200
Readability has two aspects: domain vocabulary and style.If you are
lucky enough to join a team with established style, just follow it. If
you have to define a style, then start with existing one. Good starting
point are Apple's header files and source code examples. Take a careful
look, think and analyze what you see - not just blindly copy them. If
you follow my advise you will discover that Apple style is not to
declare overridden methods (there are some exceptions - if I remember
correctly). I personally re-declare all non-trivial methods like awake*
or delegate methods because this helps me to read faster my and my
colleagues code (and I do not declare methods like init or dealloc). But
it is equally valid if you write a small perl script that answer a
question like "list all overridden methods for class X" and do not list
them in the header file. The most important lesson is to to define a
style, and to follow it all the time. (The second most important lesson
is not to bring your egos in the team room, and to avoid the endless
reasoning "my style is better then yours").
The purpose of "Learning Cocoa" is not to define a style or teach you
how to work on large projects, but to demonstrate some basic patterns of
the everyday work with the Cocoa environment (though I agree that it
will not harm if it was following a more ridged style).
gt
On Sunday, August 19, 2001, at 04:00 AM, Chris Gehlker wrote:
Short answer: readability. One should always assume that the cowboy
style of lonely hacking is a thing of the past ... or am I dreaming
again?
Well, that's just too short, at least for me. If there were a style that
said "Declare everything you define, even if it's an override" I could
understand. But that's not what "Learning Cocoa" is doing.
Georg Tuparev
Tuparev Technologies
Klipper 13
1186 VR Amstelveen
The Netherlands
Mobile: +31-6-55798196