The dangers of using keywords in method names

I understand that using keywords as variable names is unacceptable. But something made me think about using keywords in method names.

I recently inherited an Xcode project for an iOS application, where in many places I noticed that other coders used keywords in method names, such as:

- (NSMutableDictionary*) appendData:(NSMutableDictionary*)incomingData for:(NSDictionary*)responseData

and

- (int) findCompensatedIndexOf:(id)searchQuery in:(NSArray*)floorData

These methods use the keywords forand in. Now the application works absolutely fine, both in the simulator and on the devices, which means that it works as it should. On the other hand, when using CMD + Clickthe method name from the calling method in Xcode, nothing happens. Xcode jumps to the method in the corresponding class if you CMD + click on the method, but not here.

Now I understand that the application works exactly as it should, but at least I'm a little skeptical about it. After all, the OS and IDE are essentially programs, and they perceive something else.

Let us return to the question, what dangers do one person usually have (in the present or in the future) if they use keywords in method names? If it works now, does this mean that it will always work, or can future updates conflict with such methods?

NOTE. I'm not sure if this question belongs here at SO, or Programmers . I ask the moderators to make this decision and reschedule if necessary.

+4
source share
2

-, Objective-C - , , , Apple The Objective-C Language Language 2009 . , , - ( ) .

, , , . , , , . : appendData:for: findCompensatedIndexOf:in:, , , , . forest , for.

, , "" , . CMD + Click , . , :

- (void) anotherMethod:(int)x for:(int)z arg:(int)y;
- (void) anotherMethod:(int)x arg:(int)y;

CMD + , ... oops!

, .

- Apple, , - , , , Xcode .

+2

- , : "for" "in" , , , c - findCompensatedIndexOf: in: appendData: for: , , , , .

, , .

0

All Articles