I’m currently working on an objective c project, and have a method that enables/disables OR in another term: activates/deactivates a global HTTP proxy. I was wondering what is the best naming convention for such a method. The method has a BOOL argument to decide which operation to carry out, ie: enable OR disable. It is a style question which is relevant to most programming languages and i’ve decided I would love the input of this great community on this matter which is bothering me for some reason.
Is this good ? anything better or clearer ?
-(BOOL) activate:(BOOL) theActivateFlag;
or
-(BOOL) enable:(BOOL) theEnableFlag;
Will calling [proxyObj activate:NO] OR [proxyObj enable:NO] be understood as deactivating the proxy ?
Thx 🙂
I like form to reflect function in my code
At the top of the file I’d put a
and have my function be
and use it as
This isn’t the standard way of doing things, but for me it is clearer and eliminates the need for separate activators/deactivators.