$30 off During Our Annual Pro Sale. View Details »

Refactoring and stuff

Refactoring and stuff

My first talk as presented to the NYC Cocoaheads group.

Samuel Goodwin

March 09, 2012
Tweet

Other Decks in Programming

Transcript

  1. Samuel Goodwin @samuelgoodwin
    Refactoring and Stuff

    View Slide

  2. What is refactoring?
    • Changing code without changing code
    behavior.

    View Slide

  3. Why refactor?
    • Code is for humans
    • Nobody's perfect
    • Requirements change

    View Slide

  4. When to refactor?
    • When it smells
    • When code becomes too rigid
    • Maybe not before deadlines
    • Sometimes not at all ( nuke and pave! )

    View Slide

  5. How to refactor?
    • Step 0: Use version control!

    View Slide

  6. Objc_dep
    ( github.com/nst/objc_dep )

    View Slide

  7. Delete

    View Slide

  8. MVC
    Ideally...

    View Slide

  9. What to aim for?
    • Single responsibility principle
    • Open/closed principle
    • Liskov Substitution principle
    • Interface segregation principle
    • Dependency inversion principle

    View Slide

  10. • Coding Guidelines for Cocoa
    • Concepts in Objective-C Programming
    • Cocoa Fundamentals Guide
    From the guys who brought you Cocoa:

    View Slide