Jan 3, 2013

The Seven Deadly Sins of Coding-C

I’d also add a bunch of other sins. They may not be deadly, but they’re sins:
  1. Not turning on Hosey-level warnings.
  2. Not treating warnings as errors.
  3. Not fixing every single static analyzer issue.
  4. Not downloading crash logs from iTunes Connect.
  5. Putting things in your .h file that shouldn’t be public, that should be in a class extension in the .m file.
  6. Using short variable names like img and btn.
  7. Not using #pragma mark.
  8. Not understanding the concept of designated initializers.
  9. Using tap gesture recognizers when you need a button. (Think of accessibility.)
  10. Not de-queuing table cells.
  11. Calling viewDidLoad from your own code.
  12. Passing model objects to a UITableViewCell subclass.
  13. Not using conditional GET for web resources that might not change.
  14. Not testing with a clean install.
  15. Not using curly quotes — “” and ‘’ — in text that users see, including error messages.
  16. Breezy and unnecessary comments like //nil it out, kemo sabe.
  17. Not using NSLocalizedString.
  18. Using false and true instead of YES and NO.
  19. Not testing performance with Instruments.
  20. Not analyzing memory use and looking for memory leaks with Instruments.