Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

Laziness-Driven Development in iOS - Mobile Ma...

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!

Ellen Shapiro

April 14, 2016
Tweet

More Decks by Ellen Shapiro

Other Decks in Technology

Transcript

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

    | by Ellen Shapiro spothero.com | justhum.com | designatednerd.com | @designatednerd
  2. 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. YES

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

    incidentally for machines to execute."
  5. 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)
  6. Swift: Extensions MyViewExtension: extension UIView { public func xyz_circleify() {

    layer.cornerRadius = CGRectGetWidth(frame) / 2 clipsToBounds = true } }
  7. 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.
  8. Plugins AFTER Alcatraz » Push button, install plugin. » Push

    other button to see plugin page. » Search plugins easily. » Push button, uninstall plugin. !
  9. KIF

  10. KIF

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

    Image Name"]; you can write: [UIImage ac_My_Image_Name];
  12. 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.
  13. 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
  14. 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/