Re: clean up code (sorry for being stupid)
Re: clean up code (sorry for being stupid)
- Subject: Re: clean up code (sorry for being stupid)
- From: Ondra Cada <email@hidden>
- Date: Wed, 22 Aug 2001 10:22:36 +0200
Farl,
>
>>>>> Farl (F) wrote at Wed, 22 Aug 2001 00:27:37 -0700:
F> in the .h:
F>
F> -(void)function1;
I understood we are speaking _internal_ functions here, which aren't part of
the class API, but are used solely to simplify the implementation. If so,
there are no reason to place them to header (and there is a reason not to
place them there, particularly keeping the header easily readable as a quick
class documentation).
F> -(void)function1
F> {
F> //code goes here
F> }
F>
F> You call it like this:
F> [self function1];
Right, but it should be emphasized that you did not make a function, but a
method. The differences are not that important, of course; the main one
probably being that a method is always 'public', so beware names (not to
clash with other methods of a sub/superclass).
Also it would be inherited and overridable, which is again generally
unimportant, but sometimes worth knowing.
OTOH, of course, a method has access to properties, whilst a C function
would not have it.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc