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

Being for the Benefit of Future Developer

John Pignata
February 15, 2013

Being for the Benefit of Future Developer

Talk given at DUMBODevs (http://www.meetup.com/dumbo-developers) on 2/15/13.

A successful software project will pass between the hands of many different developers in its lifetime. What we sometimes bitterly refer to as "legacy code" is often the bread and butter of our organizations and "brownfield development" is the bulk of software development. Just as we've inherited projects from other developers, we leave our projects to Future Developer when we move on. His or her success and job satisfaction will be in large part dictated by the quality of what we've left behind. How do we keep our fields as green as possible for these future generations of developers? The practices we employ to deliver our projects define the genetics that guide their evolution both now and far beyond our last commit. In this talk we'll look at some practices we can use in all aspects of our day-to-day work to setup Future Developer for success and happiness.

John Pignata

February 15, 2013
Tweet

More Decks by John Pignata

Other Decks in Programming

Transcript

  1. a successful software project will likely be passed down to

    many different developers in its lifetime
  2. we’re in the best possible position to e m p

    a t h i z e w i t h future developer
  3. it’s not a license to do our jobs poorly by

    writing a check against future productivity
  4. “A developer's obligation is to make sure that the code

    as written makes the clearest possible statement as to how the solution was understood at the time of writing.” — Ward Cunningham http://c2.com/cgi/wiki?TechnicalDebt
  5. r e d u c e y o u r

    codebase to its minimum
  6. o u r s y s t e m s

    a r e defined by their interactions
  7. t h e s h a r p e r

    a c o m p o n e n t ’ s interface, the clearer your intent
  8. class Cache def initialize(storage) @storage = storage end def fetch(key)

    get(key) || set(key, yield) end private def get(key) @storage.get(key) end def set(key, data) @storage.set(key, data) data end end
  9. >> cache = Cache.new(Redis.new) => #<Cache:0x007f9170822e28 @storage=#<Redis client v3.0.2 for

    redis:// 127.0.0.1:6379/0>> >> cache.fetch(“key”) { some_expensive_operation } => :some_expensive_operation_result
  10. class Cache def initialize(storage) @storage = storage end def fetch(key)

    get(key) || set(key, yield) end private def get(key) @storage.get(key) end def set(key, data) @storage.set(key, data) data end end
  11. WTF

  12. $ git commit -am “Decompose RequestLogger The request logger middleware

    was responsible for mainipulating HTTP response headers for New Relic logging, sending measurement probes to StatsD, and outputting debugging information about a random sample of requests to the application log. This change splits up its responsibilities into three components: NewRelicHeader, StatsdTimer, DebugLogWriter. * Added coverage for middleware components * Minor consistency fixes in application config
  13. $ git rebase -i origin/master reword 0a8a3f6 Only sample for

    production pick d3d0250 Pass X-Proxy-Start as milliseconds squash 331c23f wip squash 1ee49de checkpoint: green reword b89e605 wip raise timeout if DB unavailable squash b2ed91f Speed up populate task pick db84969 Populate in a downtime migration # Rebase af190fb..10c3493 onto af190fb