Hacker News new | past | comments | ask | show | jobs | submit login

I'm a big fan of Apple's descriptive and remarkably consistent APIs, but the combination does make autocomplete errors easy to make and hard to notice. For instance:

  - tableView:didSelectRowAtIndexPath:
  - tableView:didDeselectRowAtIndexPath:
If you accidentally choose the latter, the behavior seems baffling: the first tap on an item does nothing, and every tap afterwards gives you the indexPath of the previously selected item. I'm embarrassed to admit how long I spent looking at indexPath values in the debugger and thinking "this can't be happening" before realizing what actually was happening.



I made the same mistake a couple of times! Felt so stupid once I found the bug :-/

I still prefer long descriptive method names though.

These days, I format the method so that each param goes into a newline (after Xcode autocompletes it) and this helps me catch such bugs.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: