What's the best practice to write some common tasks?

2011-11-15 Thread ico
Hi all, Suppose I have some common tasks, such as get user preferences and return some value, or do some calculation then return the result. I want to implement a function that do these kind of tasks so that I don't need to write those codes again and again. However, this function seems that it

Re: What's the best practice to write some common tasks?

2011-11-15 Thread Jens Alfke
On Nov 15, 2011, at 7:17 PM, ico wrote: So what is the best practice to place these function? Simply write them as a C function or implement them in a common class and make them static? Either way is OK, and you can find several examples of either technique in Apple’s APIs — look at