Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Erwin Zwart - Writing future proof Swift

Erwin Zwart - Writing future proof Swift

This was presented at the Swift Usergroup Netherlands. Would you like to speak/present? Visit https://swift.amsterdam for more information.

When change of code is a given, how can you write your code in such a way that has buildin flexability without doing massive refactors? Erwin talks about planning for change, drawing an outline for the future without being to specific now.

Swift Usergroup Netherlands

August 29, 2017
Tweet

More Decks by Swift Usergroup Netherlands

Other Decks in Programming

Transcript

  1. Code lives in an ever changing environment How can you

    plan for the future if you don’t know what’s ahead?
  2. On a code level • Avoid assumptions, restrict your intentions

    • Write code that models what it represent • Write shy code
  3. All of these assumptions are wrong • There are always

    24 hours in a day. • Months have either 30 or 31 days. • Years have 365 days. • Any 24-hour period will always begin and end in the same day (or week, or month). • A week always begins and ends in the same month. • A week (or a month) always begins and ends in the same year. Source: FalsehoodsAboutTime.com
  4. Write shy code • Each unit should have only limited

    knowledge about other units: only units “closely” related to the current unit. • Each unit should only talk to its friends; don’t talk to strangers. • Only talk to your immediate friends. Source: Umer Mansoor, codeahoy.com