• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: clean up code (sorry for being stupid)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >clean up code (sorry for being stupid) (From: "email@hidden" <email@hidden>)
 >Re: clean up code (sorry for being stupid) (From: email@hidden (Farl))

  • Prev by Date: Re: clean up code (sorry for being stupid)
  • Next by Date: Re: clean up code (sorry for being stupid)
  • Previous by thread: Re: clean up code (sorry for being stupid)
  • Next by thread: Re: clean up code (sorry for being stupid)
  • Index(es):
    • Date
    • Thread