Laziness-Driven Development in iOS - Mobile Makers Chicago, April 2016

Laziness-Driven Development in iOS - Mobile Makers Chicago, April 2016

Spring 2016 edition of my talk on how Laziness is secretly the best way to code.

Links galore at the end!

C4861b1dfdf3bbb21faec4a1acdf183d?s=128

Ellen Shapiro

April 14, 2016
Tweet

Transcript

  1. 1.

    Laziness-Driven Development in iOS Mobile Makers Chicago | April 2016

    | by Ellen Shapiro spothero.com | justhum.com | designatednerd.com | @designatednerd
  2. 9.

    What is Laziness-Driven Development? » Smart reuse of code »

    Clear, Readable code » Removal of Stringly-typed code » Making smart decisions today to save yourself time and heartache tomorrow
  3. 17.

    YES

  4. 21.
  5. 25.
  6. 26.
  7. 30.
  8. 31.
  9. 32.
  10. 33.
  11. 34.
  12. 35.
  13. 38.

    "programs must be written for people to read, and only

    incidentally for machines to execute."
  14. 39.

    Variable naming BAD: UIView *v var v = UIView() CGPoint

    pt var pt = CGPoint(1, 1) BETTER: UIView *profileView var profileView = UIView() CGPoint profileOrigin var profileOrigin = CGPoint(1, 1)
  15. 41.
  16. 43.
  17. 44.
  18. 45.
  19. 51.
  20. 55.
  21. 56.
  22. 57.
  23. 62.

    Swift: Extensions MyViewExtension: extension UIView { public func xyz_circleify() {

    layer.cornerRadius = CGRectGetWidth(frame) / 2 clipsToBounds = true } }
  24. 66.

    Plugins Before Alcatraz » Download project » Build, run, install,

    » Restart Xcode, » Do the hokey pokey and turn yourself about. » Uninstall by hunting down obscure folder and then forgetting what the hell you were doing in there.
  25. 67.

    Plugins AFTER Alcatraz » Push button, install plugin. » Push

    other button to see plugin page. » Search plugins easily. » Push button, uninstall plugin. !
  26. 70.
  27. 73.
  28. 80.

    KIF

  29. 81.

    KIF

  30. 86.
  31. 87.
  32. 88.
  33. 91.
  34. 94.
  35. 97.

    Cat2Cat Asset Catalog To Category Instead of writing: [UIImage imageNamed:@"My

    Image Name"]; you can write: [UIImage ac_My_Image_Name];
  36. 99.
  37. 101.
  38. 102.

    in conclusion » Centralize your code, make it easy to

    read, and keep it separated by purpose, so it's easy to fix. » Get rid of stringly-typed code so it's harder to break in the first place. » Use the tools other people have built to enhance your laziness, or build new tools yourself. » Best practices are secretly the lazy way to code.
  39. 103.
  40. 104.
  41. 105.

    Links » Alcatraz: http://alcatraz.io/ » Cocoa Controls: https://www.cocoacontrols.com/ » Swift

    In Practice: https://developer.apple.com/ videos/play/wwdc2015-411/ » CountableIntEnum: https://gist.github.com/ LoganWright/c8a26b1faf538e40f747 » Swift API Design Guidelines: https://swift.org/ documentation/api-design-guidelines
  42. 108.

    image credits » Luca Nebuloni, Pasta with finocciona: https:// www.flickr.com/photos/nebulux/10708289086

    » Tom Bech, Eurasian Wolf: https://www.flickr.com/ photos/viatorius/9358589025 » Michael D Beckwith, The Leeds Library: https:// www.flickr.com/photos/118118485@N05/16438065636/