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

RubyConf China 17/11/2012 - [UNCUT] Become a Better Developer You Can

Fred Wu
November 17, 2012

RubyConf China 17/11/2012 - [UNCUT] Become a Better Developer You Can

Fred Wu

November 17, 2012
Tweet

More Decks by Fred Wu

Other Decks in Programming

Transcript

  1. @fredwu
    Development Team Lead
    1
    Saturday, 17 November 12

    View Slide

  2. “BECOME A BETTER
    DEVELOPER
    YOU CAN”
    - Yoda
    2
    Saturday, 17 November 12

    View Slide

  3. MY BACKGROUND
    3
    Saturday, 17 November 12

    View Slide

  4. 4
    Saturday, 17 November 12

    View Slide

  5. 4
    Saturday, 17 November 12

    View Slide

  6. • 1997 Got my first computer (Intel Pentium MMX 166Mhz)
    4
    Saturday, 17 November 12

    View Slide

  7. • 1997 Got my first computer (Intel Pentium MMX 166Mhz)
    • 1997 Started using BBS (上海热线) and the Internet via 33.6Kbps modem
    4
    Saturday, 17 November 12

    View Slide

  8. • 1997 Got my first computer (Intel Pentium MMX 166Mhz)
    • 1997 Started using BBS (上海热线) and the Internet via 33.6Kbps modem
    • 1997 Made my first ever HTML web page in Microsoft Frontpage Express
    4
    Saturday, 17 November 12

    View Slide

  9. • 1997 Got my first computer (Intel Pentium MMX 166Mhz)
    • 1997 Started using BBS (上海热线) and the Internet via 33.6Kbps modem
    • 1997 Made my first ever HTML web page in Microsoft Frontpage Express
    • 1998 Moved to Australia
    4
    Saturday, 17 November 12

    View Slide

  10. • 1997 Got my first computer (Intel Pentium MMX 166Mhz)
    • 1997 Started using BBS (上海热线) and the Internet via 33.6Kbps modem
    • 1997 Made my first ever HTML web page in Microsoft Frontpage Express
    • 1998 Moved to Australia
    • 2001 Started playing with Perl (雷傲), ASP (动⺴⽹网) and PHP (Discuz!) forum software
    4
    Saturday, 17 November 12

    View Slide

  11. • 1997 Got my first computer (Intel Pentium MMX 166Mhz)
    • 1997 Started using BBS (上海热线) and the Internet via 33.6Kbps modem
    • 1997 Made my first ever HTML web page in Microsoft Frontpage Express
    • 1998 Moved to Australia
    • 2001 Started playing with Perl (雷傲), ASP (动⺴⽹网) and PHP (Discuz!) forum software
    • 2004 Started learning PHP and JavaScript in TAFE (pre-university bridge)
    4
    Saturday, 17 November 12

    View Slide

  12. • 1997 Got my first computer (Intel Pentium MMX 166Mhz)
    • 1997 Started using BBS (上海热线) and the Internet via 33.6Kbps modem
    • 1997 Made my first ever HTML web page in Microsoft Frontpage Express
    • 1998 Moved to Australia
    • 2001 Started playing with Perl (雷傲), ASP (动⺴⽹网) and PHP (Discuz!) forum software
    • 2004 Started learning PHP and JavaScript in TAFE (pre-university bridge)
    • 2006 Started working part-time as a junior developer whilst studying in university
    4
    Saturday, 17 November 12

    View Slide

  13. • 1997 Got my first computer (Intel Pentium MMX 166Mhz)
    • 1997 Started using BBS (上海热线) and the Internet via 33.6Kbps modem
    • 1997 Made my first ever HTML web page in Microsoft Frontpage Express
    • 1998 Moved to Australia
    • 2001 Started playing with Perl (雷傲), ASP (动⺴⽹网) and PHP (Discuz!) forum software
    • 2004 Started learning PHP and JavaScript in TAFE (pre-university bridge)
    • 2006 Started working part-time as a junior developer whilst studying in university
    • 2006 Discovered Ruby and Ruby on Rails, and switched to OS X because of Textmate
    4
    Saturday, 17 November 12

    View Slide

  14. • 1997 Got my first computer (Intel Pentium MMX 166Mhz)
    • 1997 Started using BBS (上海热线) and the Internet via 33.6Kbps modem
    • 1997 Made my first ever HTML web page in Microsoft Frontpage Express
    • 1998 Moved to Australia
    • 2001 Started playing with Perl (雷傲), ASP (动⺴⽹网) and PHP (Discuz!) forum software
    • 2004 Started learning PHP and JavaScript in TAFE (pre-university bridge)
    • 2006 Started working part-time as a junior developer whilst studying in university
    • 2006 Discovered Ruby and Ruby on Rails, and switched to OS X because of Textmate
    • 2008 Started professionally as a web developer (HTML, CSS, PHP and JavaScript)
    4
    Saturday, 17 November 12

    View Slide

  15. • 1997 Got my first computer (Intel Pentium MMX 166Mhz)
    • 1997 Started using BBS (上海热线) and the Internet via 33.6Kbps modem
    • 1997 Made my first ever HTML web page in Microsoft Frontpage Express
    • 1998 Moved to Australia
    • 2001 Started playing with Perl (雷傲), ASP (动⺴⽹网) and PHP (Discuz!) forum software
    • 2004 Started learning PHP and JavaScript in TAFE (pre-university bridge)
    • 2006 Started working part-time as a junior developer whilst studying in university
    • 2006 Discovered Ruby and Ruby on Rails, and switched to OS X because of Textmate
    • 2008 Started professionally as a web developer (HTML, CSS, PHP and JavaScript)
    • 2010 Started programming in Ruby full time (mostly)
    4
    Saturday, 17 November 12

    View Slide

  16. • 1997 Got my first computer (Intel Pentium MMX 166Mhz)
    • 1997 Started using BBS (上海热线) and the Internet via 33.6Kbps modem
    • 1997 Made my first ever HTML web page in Microsoft Frontpage Express
    • 1998 Moved to Australia
    • 2001 Started playing with Perl (雷傲), ASP (动⺴⽹网) and PHP (Discuz!) forum software
    • 2004 Started learning PHP and JavaScript in TAFE (pre-university bridge)
    • 2006 Started working part-time as a junior developer whilst studying in university
    • 2006 Discovered Ruby and Ruby on Rails, and switched to OS X because of Textmate
    • 2008 Started professionally as a web developer (HTML, CSS, PHP and JavaScript)
    • 2010 Started programming in Ruby full time (mostly)
    • 2010 Started contributing to many open source ruby projects, including Ruby on Rails
    4
    Saturday, 17 November 12

    View Slide

  17. 2004 2005 2006 2007 2008 2009 2010 2011 2012
    JavaScript PHP Ruby
    AREAS OF FOCUS
    5
    Saturday, 17 November 12

    View Slide

  18. AUSTRALIA HAS A STRONG
    RUBY COMMUNITY
    6
    Saturday, 17 November 12

    View Slide

  19. 7
    Saturday, 17 November 12

    View Slide

  20. Dr Nic Williams
    Author of Rails Textmate bundle,
    works at Engine Yard
    Ryan Bigg
    Author of Rails 3 in Action,
    2011 Ruby Hero
    Pat Allan
    Author of Thinking Sphinx,
    2009 Ruby Hero
    Xavier Shay
    Author of Cane and Enki,
    works at Square
    Ben Schwarz
    Member of W3C’s
    CSS Working Group
    Darcy Laycock
    Author of API Smith,
    2011 Ruby Hero
    Justin French
    Author of Formtastic
    Daniel Neighman
    Author of Warden,
    works at Square
    Ben Hoskings
    Author of Babushka
    Marcus Crafter
    Author of Sprinkle
    Charlie Somerville
    Author of Slash language,
    a talented 18 year old!
    Jack Chen (Chendo)
    Contributor to iTerm2
    Mikel Lindsaar
    Author of Mail,
    rails core committer
    John Barton
    Cofounder of Goodfil.ms,
    dev manager of Envato for 3+ years
    Paul Annesley
    Built 99designs,
    works at SitePoint
    Gareth Townsend
    Founder of Melbourne Cocoaheads
    Ivan Vanderbyl
    Founder of Crashlog
    Glen Maddern
    Cofounder of Goodfil.ms
    Alan Harper
    Author of Rubyzip
    James Healy
    Author of PDF::Reader,
    maintainer of Prawn
    Florian Hanke
    Author of Picky
    7
    Saturday, 17 November 12

    View Slide

  21. • General Tips and Thoughts
    • Code Tips and Examples
    • Q & A (提问时间,中⽂文)
    ABOUT THIS TALK
    8
    Saturday, 17 November 12

    View Slide

  22. THREE STAGES OF ...
    9
    Saturday, 17 November 12

    View Slide

  23. THREE STAGES OF
    PHOTOGRAPHY
    10
    Saturday, 17 November 12

    View Slide

  24. THREE STAGES OF
    PHOTOGRAPHY
    1. You discuss camera equipment.
    三流摄影师谈器材。
    10
    Saturday, 17 November 12

    View Slide

  25. THREE STAGES OF
    PHOTOGRAPHY
    1. You discuss camera equipment.
    三流摄影师谈器材。
    2. You discuss shooting techniques.
    ⼆二流摄影师谈技术。
    10
    Saturday, 17 November 12

    View Slide

  26. THREE STAGES OF
    PHOTOGRAPHY
    1. You discuss camera equipment.
    三流摄影师谈器材。
    2. You discuss shooting techniques.
    ⼆二流摄影师谈技术。
    3. You discuss creative and thought processes.
    ⼀一流摄影师谈思想。
    10
    Saturday, 17 November 12

    View Slide

  27. THREE STAGES OF
    PROGRAMMERS
    11
    Saturday, 17 November 12

    View Slide

  28. THREE STAGES OF
    PROGRAMMERS
    1. You discuss tools and editors.
    三流程序员谈⼯工具。
    11
    Saturday, 17 November 12

    View Slide

  29. THREE STAGES OF
    PROGRAMMERS
    1. You discuss tools and editors.
    三流程序员谈⼯工具。
    2. You discuss programming techniques.
    ⼆二流程序员谈技术。
    11
    Saturday, 17 November 12

    View Slide

  30. THREE STAGES OF
    PROGRAMMERS
    1. You discuss tools and editors.
    三流程序员谈⼯工具。
    2. You discuss programming techniques.
    ⼆二流程序员谈技术。
    3. You discuss creative and thought processes.
    ⼀一流程序员谈思想。
    11
    Saturday, 17 November 12

    View Slide

  31. THREE STAGES OF
    SOFTWARE DEVELOPMENT
    12
    Saturday, 17 November 12

    View Slide

  32. THREE STAGES OF
    SOFTWARE DEVELOPMENT
    1. You are being paid for what you do.
    三流程序员提供汗⽔水。
    12
    Saturday, 17 November 12

    View Slide

  33. THREE STAGES OF
    SOFTWARE DEVELOPMENT
    1. You are being paid for what you do.
    三流程序员提供汗⽔水。
    2. You are being paid for what you know.
    ⼆二流程序员提供脑⼒力。
    12
    Saturday, 17 November 12

    View Slide

  34. THREE STAGES OF
    SOFTWARE DEVELOPMENT
    1. You are being paid for what you do.
    三流程序员提供汗⽔水。
    2. You are being paid for what you know.
    ⼆二流程序员提供脑⼒力。
    3. You are being paid for your experience.
    ⼀一流程序员提供经验。
    12
    Saturday, 17 November 12

    View Slide

  35. DISCLAIMER
    I am still a n00b. ⼩小⼩小菜⻦鸟。
    But I care, so I share. 抛砖引⽟玉。
    13
    Saturday, 17 November 12

    View Slide

  36. WHERE TO START
    14
    Saturday, 17 November 12

    View Slide

  37. • What interests you?
    WHERE TO START
    14
    Saturday, 17 November 12

    View Slide

  38. • What interests you?
    • Product? 产品控
    WHERE TO START
    14
    Saturday, 17 November 12

    View Slide

  39. • What interests you?
    • Product? 产品控
    • Technology? 技术控
    WHERE TO START
    14
    Saturday, 17 November 12

    View Slide

  40. • What interests you?
    • Product? 产品控
    • Technology? 技术控
    • Maths and algorithm? 算法控
    WHERE TO START
    14
    Saturday, 17 November 12

    View Slide

  41. • What interests you?
    • Product? 产品控
    • Technology? 技术控
    • Maths and algorithm? 算法控
    • Money? ⾦金钱控
    WHERE TO START
    14
    Saturday, 17 November 12

    View Slide

  42. • What interests you?
    • Product? 产品控
    • Technology? 技术控
    • Maths and algorithm? 算法控
    • Money? ⾦金钱控
    • Choose where to work wisely
    WHERE TO START
    14
    Saturday, 17 November 12

    View Slide

  43. • What interests you?
    • Product? 产品控
    • Technology? 技术控
    • Maths and algorithm? 算法控
    • Money? ⾦金钱控
    • Choose where to work wisely
    • But it probably doesn’t matter (as much) for the first year or two
    WHERE TO START
    14
    Saturday, 17 November 12

    View Slide

  44. THE ART OF
    ASKING QUESTIONS
    15
    Saturday, 17 November 12

    View Slide

  45. THE ART OF
    ASKING QUESTIONS
    • Don’t be vague (“Can I use Rails for XYZ?” is not a good question).
    模棱两可惹⼈人厌。
    15
    Saturday, 17 November 12

    View Slide

  46. THE ART OF
    ASKING QUESTIONS
    • Don’t be vague (“Can I use Rails for XYZ?” is not a good question).
    模棱两可惹⼈人厌。
    • Give context and details (e.g. error stack trace).
    提供上下⽂文与出错报告。
    15
    Saturday, 17 November 12

    View Slide

  47. THE ART OF
    ASKING QUESTIONS
    • Don’t be vague (“Can I use Rails for XYZ?” is not a good question).
    模棱两可惹⼈人厌。
    • Give context and details (e.g. error stack trace).
    提供上下⽂文与出错报告。
    • Show that you’ve done your research.
    必要的功课先做好。
    15
    Saturday, 17 November 12

    View Slide

  48. THE ART OF
    ASKING QUESTIONS
    • Don’t be vague (“Can I use Rails for XYZ?” is not a good question).
    模棱两可惹⼈人厌。
    • Give context and details (e.g. error stack trace).
    提供上下⽂文与出错报告。
    • Show that you’ve done your research.
    必要的功课先做好。
    • Respect the answers and comments offered to you.
    尊重别⼈人给出的答案和意⻅见。
    15
    Saturday, 17 November 12

    View Slide

  49. THE ART OF
    ASKING QUESTIONS
    • Don’t be vague (“Can I use Rails for XYZ?” is not a good question).
    模棱两可惹⼈人厌。
    • Give context and details (e.g. error stack trace).
    提供上下⽂文与出错报告。
    • Show that you’ve done your research.
    必要的功课先做好。
    • Respect the answers and comments offered to you.
    尊重别⼈人给出的答案和意⻅见。
    • Be mindful of how many questions you ask.
    短时间内不要提⼤大量的问题。
    15
    Saturday, 17 November 12

    View Slide

  50. THE ART OF
    ASKING QUESTIONS
    • Don’t be vague (“Can I use Rails for XYZ?” is not a good question).
    模棱两可惹⼈人厌。
    • Give context and details (e.g. error stack trace).
    提供上下⽂文与出错报告。
    • Show that you’ve done your research.
    必要的功课先做好。
    • Respect the answers and comments offered to you.
    尊重别⼈人给出的答案和意⻅见。
    • Be mindful of how many questions you ask.
    短时间内不要提⼤大量的问题。
    • Don’t be a Help Vampire! http://slash7.com/2006/12/22/vampires/
    15
    Saturday, 17 November 12

    View Slide

  51. BE MINDFUL WHAT YOU SAY
    16
    Saturday, 17 November 12

    View Slide

  52. BE MINDFUL WHAT YOU SAY
    • Be nice! Attacking people on Twitter or Weibo is not cool.
    基本道德:不攻击他⼈人。
    16
    Saturday, 17 November 12

    View Slide

  53. BE MINDFUL WHAT YOU SAY
    • Be nice! Attacking people on Twitter or Weibo is not cool.
    基本道德:不攻击他⼈人。
    • Make sure you checked your facts.
    事实胜于雄辩。
    16
    Saturday, 17 November 12

    View Slide

  54. BE MINDFUL WHAT YOU SAY
    • Be nice! Attacking people on Twitter or Weibo is not cool.
    基本道德:不攻击他⼈人。
    • Make sure you checked your facts.
    事实胜于雄辩。
    • Deflect office politics.
    规避办公室政治。
    16
    Saturday, 17 November 12

    View Slide

  55. BE MINDFUL WHAT YOU SAY
    • Be nice! Attacking people on Twitter or Weibo is not cool.
    基本道德:不攻击他⼈人。
    • Make sure you checked your facts.
    事实胜于雄辩。
    • Deflect office politics.
    规避办公室政治。
    • Don’t spread pirate links!
    不散播盗版链接。
    16
    Saturday, 17 November 12

    View Slide

  56. BE MINDFUL WHAT YOU SAY
    • Be nice! Attacking people on Twitter or Weibo is not cool.
    基本道德:不攻击他⼈人。
    • Make sure you checked your facts.
    事实胜于雄辩。
    • Deflect office politics.
    规避办公室政治。
    • Don’t spread pirate links!
    不散播盗版链接。
    • Don’t waste energy in endless debates.
    不参与⽆无谓的争辩。
    Credit: xkcd.com
    16
    Saturday, 17 November 12

    View Slide

  57. ADJUST
    CONFIDENCE LEVEL
    17
    Saturday, 17 November 12

    View Slide

  58. ADJUST
    CONFIDENCE LEVEL
    • Aim too low you’ll never improve.
    ⺫⽬目标定太低,难以进步。
    17
    Saturday, 17 November 12

    View Slide

  59. ADJUST
    CONFIDENCE LEVEL
    • Aim too low you’ll never improve.
    ⺫⽬目标定太低,难以进步。
    • Aim too high you’ll be depressed.
    ⺫⽬目标定太⾼高,永追不上。
    17
    Saturday, 17 November 12

    View Slide

  60. ADJUST
    CONFIDENCE LEVEL
    • Aim too low you’ll never improve.
    ⺫⽬目标定太低,难以进步。
    • Aim too high you’ll be depressed.
    ⺫⽬目标定太⾼高,永追不上。
    • So make your goals @variables rather than CONSTANTS.
    把⺫⽬目标设为变量,⽽而⾮非常量。
    17
    Saturday, 17 November 12

    View Slide

  61. THOUGHTS ON
    SOFTWARE DEVELOPMENT
    18
    Saturday, 17 November 12

    View Slide

  62. THOUGHTS ON
    SOFTWARE DEVELOPMENT
    • Second system syndrome - avoid total rewrites.
    第⼆二系统综合症——避免重写。
    18
    Saturday, 17 November 12

    View Slide

  63. THOUGHTS ON
    SOFTWARE DEVELOPMENT
    • Second system syndrome - avoid total rewrites.
    第⼆二系统综合症——避免重写。
    • Software engineering is like playing Starcraft - always check your mini-map.
    软件⼯工程有如星际争霸——需经常关注迷你地图,以⼤大局为重。
    18
    Saturday, 17 November 12

    View Slide

  64. THOUGHTS ON
    SOFTWARE DEVELOPMENT
    • Second system syndrome - avoid total rewrites.
    第⼆二系统综合症——避免重写。
    • Software engineering is like playing Starcraft - always check your mini-map.
    软件⼯工程有如星际争霸——需经常关注迷你地图,以⼤大局为重。
    • Experience is as important as talent, if not more important.
    经验与天赋同重要。
    18
    Saturday, 17 November 12

    View Slide

  65. THOUGHTS ON
    SOFTWARE DEVELOPMENT
    • Second system syndrome - avoid total rewrites.
    第⼆二系统综合症——避免重写。
    • Software engineering is like playing Starcraft - always check your mini-map.
    软件⼯工程有如星际争霸——需经常关注迷你地图,以⼤大局为重。
    • Experience is as important as talent, if not more important.
    经验与天赋同重要。
    • Technical debt is a debt, the longer you wait, the more interests you pay.
    技术债务——拖⽋欠越久,偿还越多。
    18
    Saturday, 17 November 12

    View Slide

  66. THOUGHTS ON
    SOFTWARE DEVELOPMENT
    • Second system syndrome - avoid total rewrites.
    第⼆二系统综合症——避免重写。
    • Software engineering is like playing Starcraft - always check your mini-map.
    软件⼯工程有如星际争霸——需经常关注迷你地图,以⼤大局为重。
    • Experience is as important as talent, if not more important.
    经验与天赋同重要。
    • Technical debt is a debt, the longer you wait, the more interests you pay.
    技术债务——拖⽋欠越久,偿还越多。
    • Choose the application architecture wisely.
    谨慎选择软件架构。
    18
    Saturday, 17 November 12

    View Slide

  67. APPLICATION ARCHITECTURE
    SHOWCASE
    19
    Saturday, 17 November 12

    View Slide

  68. APPLICATION ARCHITECTURE
    SHOWCASE
    • We need a profile system to hold user data.
    ⽤用户帐户系统。
    19
    Saturday, 17 November 12

    View Slide

  69. APPLICATION ARCHITECTURE
    SHOWCASE
    • We need a profile system to hold user data.
    ⽤用户帐户系统。
    • The profile system will potentially be used standalone.
    ⽤用户帐户系统未来可能会被独⽴立使⽤用。
    19
    Saturday, 17 November 12

    View Slide

  70. APPLICATION ARCHITECTURE
    SHOWCASE
    • We need a profile system to hold user data.
    ⽤用户帐户系统。
    • The profile system will potentially be used standalone.
    ⽤用户帐户系统未来可能会被独⽴立使⽤用。
    • We need plugin-able “modules”.
    需可插⼊入式模块系统。
    19
    Saturday, 17 November 12

    View Slide

  71. APPLICATION ARCHITECTURE
    SHOWCASE
    • We need a profile system to hold user data.
    ⽤用户帐户系统。
    • The profile system will potentially be used standalone.
    ⽤用户帐户系统未来可能会被独⽴立使⽤用。
    • We need plugin-able “modules”.
    需可插⼊入式模块系统。
    • There will potentially be 3rd party modules.
    未来可能会有第三⽅方开发的模块。
    19
    Saturday, 17 November 12

    View Slide

  72. APPLICATION ARCHITECTURE
    SHOWCASE
    • We need a profile system to hold user data.
    ⽤用户帐户系统。
    • The profile system will potentially be used standalone.
    ⽤用户帐户系统未来可能会被独⽴立使⽤用。
    • We need plugin-able “modules”.
    需可插⼊入式模块系统。
    • There will potentially be 3rd party modules.
    未来可能会有第三⽅方开发的模块。
    • Of course, the development timeline is tight.
    开发周期很紧凑。
    19
    Saturday, 17 November 12

    View Slide

  73. SOLUTION I
    THE PERFECT WAY
    Profile (API) Platform
    Module
    Module
    Module
    20
    Saturday, 17 November 12

    View Slide

  74. PERFECT? NO!
    21
    Saturday, 17 November 12

    View Slide

  75. PERFECT? NO!
    • Longer development time.
    开发周期过⻓长。
    21
    Saturday, 17 November 12

    View Slide

  76. PERFECT? NO!
    • Longer development time.
    开发周期过⻓长。
    • Can’t guarantee the usefulness of the API layer for 3rd party
    developers.
    不可预知 API 层在未来是否还可有效利⽤用。
    21
    Saturday, 17 November 12

    View Slide

  77. PERFECT? NO!
    • Longer development time.
    开发周期过⻓长。
    • Can’t guarantee the usefulness of the API layer for 3rd party
    developers.
    不可预知 API 层在未来是否还可有效利⽤用。
    • More complexity == more chances to screw up.
    系统越复杂,越容易出错。
    21
    Saturday, 17 November 12

    View Slide

  78. SOLUTION II
    THE EASY WAY
    Platform
    Profile
    Module
    Module
    Module
    22
    Saturday, 17 November 12

    View Slide

  79. EASY,
    BUT FOR HOW LONG?
    23
    Saturday, 17 November 12

    View Slide

  80. EASY,
    BUT FOR HOW LONG?
    • One app is more difficult to scale out.
    单⼀一系统相对较难向外扩展。
    23
    Saturday, 17 November 12

    View Slide

  81. EASY,
    BUT FOR HOW LONG?
    • One app is more difficult to scale out.
    单⼀一系统相对较难向外扩展。
    • It is also more difficult to assign tasks.
    单⼀一系统相对较难安排团队成员任务。
    23
    Saturday, 17 November 12

    View Slide

  82. EASY,
    BUT FOR HOW LONG?
    • One app is more difficult to scale out.
    单⼀一系统相对较难向外扩展。
    • It is also more difficult to assign tasks.
    单⼀一系统相对较难安排团队成员任务。
    • It is more likely to have leaky code.
    单⼀一系统相对更难有效封装。
    23
    Saturday, 17 November 12

    View Slide

  83. SOLUTION III
    THE CHOSEN WAY
    Profile (API) Platform
    Module
    Module
    Module
    24
    Saturday, 17 November 12

    View Slide

  84. A BALANCED SOLUTION
    IS A GOOD SOLUTION
    25
    Saturday, 17 November 12

    View Slide

  85. A BALANCED SOLUTION
    IS A GOOD SOLUTION
    • Don’t over-engineer.
    避免过度⼯工程。
    25
    Saturday, 17 November 12

    View Slide

  86. A BALANCED SOLUTION
    IS A GOOD SOLUTION
    • Don’t over-engineer.
    避免过度⼯工程。
    • Good degree of separation of concern.
    注重关注点分离。
    25
    Saturday, 17 November 12

    View Slide

  87. A BALANCED SOLUTION
    IS A GOOD SOLUTION
    • Don’t over-engineer.
    避免过度⼯工程。
    • Good degree of separation of concern.
    注重关注点分离。
    • Internal interfaces are easier than external APIs:
    内部接⼝口相对外部 API 更易开发:
    ‣ @gateway ||= PlatformModuleGateway.new(args)
    ‣ mod = module_controller(module_name).new(args)
    ‣ mod.validate_input
    ‣ mod.render_view
    25
    Saturday, 17 November 12

    View Slide

  88. OOPS!
    26
    Saturday, 17 November 12

    View Slide

  89. OOPS!
    27
    Saturday, 17 November 12

    View Slide

  90. Rackspace
    Private Cloud VM
    External
    Providers
    NGINX
    Front End
    HTTP SERVER
    (Long-polling,
    Cache, SSL)
    UNICORN
    Worker 1
    Worker 2
    Worker 3
    Worker N
    Request
    Router
    Auth
    Admin
    Controller
    Workflow
    Controler
    User Data
    Source
    (Rails engine
    modules)
    Gateway
    M
    V
    C
    M
    V
    C
    M
    V
    C
    M
    V
    C
    M
    V
    C
    Mailer
    MySQL
    Application
    Server
    Master
    Sendmail
    Active
    Record
    ORM
    UNICORN
    Worker 1
    Worker 2
    Worker N
    Application
    Server
    Master
    Group
    Manager
    Roles
    Manager
    User
    Profile
    Manager
    Authentication
    System
    Permissions
    Management
    CRON
    DFAT
    Scraper
    Master
    Worker
    Event
    Machine
    Country
    Scraper
    Regional
    Scraper
    Local DB
    Server
    Active
    Record
    ORM
    Data
    Mapper
    ORM
    Profile
    TMP
    Firewall
    Firewall
    UNIX
    Socket
    HTTP
    JSON
    HTTPS
    UNIX
    Socket
    Client
    HART
    Aviation
    API
    JSON
    (SSL)
    CDC
    VISA
    Link
    28
    Saturday, 17 November 12

    View Slide

  91. Rackspace
    Private Cloud VM
    External
    Providers
    NGINX
    Front End
    HTTP SERVER
    (Long-polling,
    Cache, SSL)
    UNICORN
    Worker 1
    Worker 2
    Worker 3
    Worker N
    Request
    Router
    Auth
    Admin
    Controller
    Workflow
    Controler
    User Data
    Source
    (Rails engine
    modules)
    Gateway
    M
    V
    C
    M
    V
    C
    M
    V
    C
    M
    V
    C
    M
    V
    C
    Mailer
    MySQL
    Application
    Server
    Master
    Sendmail
    Active
    Record
    ORM
    UNICORN
    Worker 1
    Worker 2
    Worker N
    Application
    Server
    Master
    Group
    Manager
    Roles
    Manager
    User
    Profile
    Manager
    Authentication
    System
    Permissions
    Management
    CRON
    DFAT
    Scraper
    Master
    Worker
    Event
    Machine
    Country
    Scraper
    Regional
    Scraper
    Local DB
    Server
    Active
    Record
    ORM
    Data
    Mapper
    ORM
    Profile
    TMP
    Firewall
    Firewall
    UNIX
    Socket
    HTTP
    JSON
    HTTPS
    UNIX
    Socket
    Client
    HART
    Aviation
    API
    JSON
    (SSL)
    CDC
    VISA
    Link
    28
    Saturday, 17 November 12

    View Slide

  92. Rackspace
    Private Cloud VM
    External
    Providers
    NGINX
    Front End
    HTTP SERVER
    (Long-polling,
    Cache, SSL)
    UNICORN
    Worker 1
    Worker 2
    Worker 3
    Worker N
    Request
    Router
    Auth
    Admin
    Controller
    Workflow
    Controler
    User Data
    Source
    (Rails engine
    modules)
    Gateway
    M
    V
    C
    M
    V
    C
    M
    V
    C
    M
    V
    C
    M
    V
    C
    Mailer
    MySQL
    Application
    Server
    Master
    Sendmail
    Active
    Record
    ORM
    UNICORN
    Worker 1
    Worker 2
    Worker N
    Application
    Server
    Master
    Group
    Manager
    Roles
    Manager
    User
    Profile
    Manager
    Authentication
    System
    Permissions
    Management
    CRON
    DFAT
    Scraper
    Master
    Worker
    Event
    Machine
    Country
    Scraper
    Regional
    Scraper
    Local DB
    Server
    Active
    Record
    ORM
    Data
    Mapper
    ORM
    Profile
    TMP
    Firewall
    Firewall
    UNIX
    Socket
    HTTP
    JSON
    HTTPS
    UNIX
    Socket
    Client
    HART
    Aviation
    API
    JSON
    (SSL)
    CDC
    VISA
    Link
    28
    Saturday, 17 November 12

    View Slide

  93. Rackspace
    Private Cloud VM
    External
    Providers
    NGINX
    Front End
    HTTP SERVER
    (Long-polling,
    Cache, SSL)
    UNICORN
    Worker 1
    Worker 2
    Worker 3
    Worker N
    Request
    Router
    Auth
    Admin
    Controller
    Workflow
    Controler
    User Data
    Source
    (Rails engine
    modules)
    Gateway
    M
    V
    C
    M
    V
    C
    M
    V
    C
    M
    V
    C
    M
    V
    C
    Mailer
    MySQL
    Application
    Server
    Master
    Sendmail
    Active
    Record
    ORM
    UNICORN
    Worker 1
    Worker 2
    Worker N
    Application
    Server
    Master
    Group
    Manager
    Roles
    Manager
    User
    Profile
    Manager
    Authentication
    System
    Permissions
    Management
    CRON
    DFAT
    Scraper
    Master
    Worker
    Event
    Machine
    Country
    Scraper
    Regional
    Scraper
    Local DB
    Server
    Active
    Record
    ORM
    Data
    Mapper
    ORM
    Profile
    TMP
    Firewall
    Firewall
    UNIX
    Socket
    HTTP
    JSON
    HTTPS
    UNIX
    Socket
    Client
    HART
    Aviation
    API
    JSON
    (SSL)
    CDC
    VISA
    Link
    28
    Saturday, 17 November 12

    View Slide

  94. Rackspace
    Private Cloud VM
    External
    Providers
    NGINX
    Front End
    HTTP SERVER
    (Long-polling,
    Cache, SSL)
    UNICORN
    Worker 1
    Worker 2
    Worker 3
    Worker N
    Request
    Router
    Auth
    Admin
    Controller
    Workflow
    Controler
    User Data
    Source
    (Rails engine
    modules)
    Gateway
    M
    V
    C
    M
    V
    C
    M
    V
    C
    M
    V
    C
    M
    V
    C
    Mailer
    MySQL
    Application
    Server
    Master
    Sendmail
    Active
    Record
    ORM
    UNICORN
    Worker 1
    Worker 2
    Worker N
    Application
    Server
    Master
    Group
    Manager
    Roles
    Manager
    User
    Profile
    Manager
    Authentication
    System
    Permissions
    Management
    CRON
    DFAT
    Scraper
    Master
    Worker
    Event
    Machine
    Country
    Scraper
    Regional
    Scraper
    Local DB
    Server
    Active
    Record
    ORM
    Data
    Mapper
    ORM
    Profile
    TMP
    Firewall
    Firewall
    UNIX
    Socket
    HTTP
    JSON
    HTTPS
    UNIX
    Socket
    Client
    HART
    Aviation
    API
    JSON
    (SSL)
    CDC
    VISA
    Link
    28
    Saturday, 17 November 12

    View Slide

  95. Rackspace
    Private Cloud VM
    External
    Providers
    NGINX
    Front End
    HTTP SERVER
    (Long-polling,
    Cache, SSL)
    UNICORN
    Worker 1
    Worker 2
    Worker 3
    Worker N
    Request
    Router
    Auth
    Admin
    Controller
    Workflow
    Controler
    User Data
    Source
    (Rails engine
    modules)
    Gateway
    M
    V
    C
    M
    V
    C
    M
    V
    C
    M
    V
    C
    M
    V
    C
    Mailer
    MySQL
    Application
    Server
    Master
    Sendmail
    Active
    Record
    ORM
    UNICORN
    Worker 1
    Worker 2
    Worker N
    Application
    Server
    Master
    Group
    Manager
    Roles
    Manager
    User
    Profile
    Manager
    Authentication
    System
    Permissions
    Management
    CRON
    DFAT
    Scraper
    Master
    Worker
    Event
    Machine
    Country
    Scraper
    Regional
    Scraper
    Local DB
    Server
    Active
    Record
    ORM
    Data
    Mapper
    ORM
    Profile
    TMP
    Firewall
    Firewall
    UNIX
    Socket
    HTTP
    JSON
    HTTPS
    UNIX
    Socket
    Client
    HART
    Aviation
    API
    JSON
    (SSL)
    CDC
    VISA
    Link
    28
    Saturday, 17 November 12

    View Slide

  96. Rackspace
    Private Cloud VM
    External
    Providers
    NGINX
    Front End
    HTTP SERVER
    (Long-polling,
    Cache, SSL)
    UNICORN
    Worker 1
    Worker 2
    Worker 3
    Worker N
    Request
    Router
    Auth
    Admin
    Controller
    Workflow
    Controler
    User Data
    Source
    (Rails engine
    modules)
    Gateway
    M
    V
    C
    M
    V
    C
    M
    V
    C
    M
    V
    C
    M
    V
    C
    Mailer
    MySQL
    Application
    Server
    Master
    Sendmail
    Active
    Record
    ORM
    UNICORN
    Worker 1
    Worker 2
    Worker N
    Application
    Server
    Master
    Group
    Manager
    Roles
    Manager
    User
    Profile
    Manager
    Authentication
    System
    Permissions
    Management
    CRON
    DFAT
    Scraper
    Master
    Worker
    Event
    Machine
    Country
    Scraper
    Regional
    Scraper
    Local DB
    Server
    Active
    Record
    ORM
    Data
    Mapper
    ORM
    Profile
    TMP
    Firewall
    Firewall
    UNIX
    Socket
    HTTP
    JSON
    HTTPS
    UNIX
    Socket
    Client
    HART
    Aviation
    API
    JSON
    (SSL)
    CDC
    VISA
    Link
    28
    Saturday, 17 November 12

    View Slide

  97. Rackspace
    Private Cloud VM
    External
    Providers
    NGINX
    Front End
    HTTP SERVER
    (Long-polling,
    Cache, SSL)
    UNICORN
    Worker 1
    Worker 2
    Worker 3
    Worker N
    Request
    Router
    Auth
    Admin
    Controller
    Workflow
    Controler
    User Data
    Source
    (Rails engine
    modules)
    Gateway
    M
    V
    C
    M
    V
    C
    M
    V
    C
    M
    V
    C
    M
    V
    C
    Mailer
    MySQL
    Application
    Server
    Master
    Sendmail
    Active
    Record
    ORM
    UNICORN
    Worker 1
    Worker 2
    Worker N
    Application
    Server
    Master
    Group
    Manager
    Roles
    Manager
    User
    Profile
    Manager
    Authentication
    System
    Permissions
    Management
    CRON
    DFAT
    Scraper
    Master
    Worker
    Event
    Machine
    Country
    Scraper
    Regional
    Scraper
    Local DB
    Server
    Active
    Record
    ORM
    Data
    Mapper
    ORM
    Profile
    TMP
    Firewall
    Firewall
    UNIX
    Socket
    HTTP
    JSON
    HTTPS
    UNIX
    Socket
    Client
    HART
    Aviation
    API
    JSON
    (SSL)
    CDC
    VISA
    Link
    28
    Saturday, 17 November 12

    View Slide

  98. CRAP PRINCIPLES
    29
    Saturday, 17 November 12

    View Slide

  99. 30
    Saturday, 17 November 12

    View Slide

  100. Contrast 对⽐比度
    30
    Saturday, 17 November 12

    View Slide

  101. Contrast 对⽐比度
    Repetition 重复度
    30
    Saturday, 17 November 12

    View Slide

  102. Contrast 对⽐比度
    Repetition 重复度
    Alignment 排列度
    30
    Saturday, 17 November 12

    View Slide

  103. Contrast 对⽐比度
    Repetition 重复度
    Alignment 排列度
    Proximity 接近度
    30
    Saturday, 17 November 12

    View Slide

  104. SOLID PRINCIPLES
    31
    Saturday, 17 November 12

    View Slide

  105. 32
    Saturday, 17 November 12

    View Slide

  106. Single responsibility 单⼀一责任
    32
    Saturday, 17 November 12

    View Slide

  107. Single responsibility 单⼀一责任
    Open/close 开闭
    32
    Saturday, 17 November 12

    View Slide

  108. Single responsibility 单⼀一责任
    Open/close 开闭
    Liskov substitution ⾥里⽒氏替换
    32
    Saturday, 17 November 12

    View Slide

  109. Single responsibility 单⼀一责任
    Open/close 开闭
    Liskov substitution ⾥里⽒氏替换
    Interface segregation 接⼝口分离
    32
    Saturday, 17 November 12

    View Slide

  110. Single responsibility 单⼀一责任
    Open/close 开闭
    Liskov substitution ⾥里⽒氏替换
    Interface segregation 接⼝口分离
    Dependency inversion 依赖倒置
    32
    Saturday, 17 November 12

    View Slide

  111. FOUR SIMPLE RULES
    33
    Saturday, 17 November 12

    View Slide

  112. 34
    Saturday, 17 November 12

    View Slide

  113. Passes all the tests.
    34
    Saturday, 17 November 12

    View Slide

  114. Passes all the tests.
    Contains no duplication.
    34
    Saturday, 17 November 12

    View Slide

  115. Passes all the tests.
    Contains no duplication.
    Expresses the intent.
    34
    Saturday, 17 November 12

    View Slide

  116. Passes all the tests.
    Contains no duplication.
    Expresses the intent.
    Minimises the number of classes and methods.
    34
    Saturday, 17 November 12

    View Slide

  117. Until you have learnt Ruby first.
    DO NOT LEARN RAILS
    35
    Saturday, 17 November 12

    View Slide

  118. AGILE? TDD?
    36
    Saturday, 17 November 12

    View Slide

  119. ONE SIZE FITS ALL?
    37
    Saturday, 17 November 12

    View Slide

  120. ONE SIZE FITS ALL?
    • Scrum, Kanban, XP, Lean, Crystal... whatever...
    37
    Saturday, 17 November 12

    View Slide

  121. ONE SIZE FITS ALL?
    • Scrum, Kanban, XP, Lean, Crystal... whatever...
    • TDD? BDD? Test first, or verify later?
    37
    Saturday, 17 November 12

    View Slide

  122. ONE SIZE FITS ALL?
    • Scrum, Kanban, XP, Lean, Crystal... whatever...
    • TDD? BDD? Test first, or verify later?
    • If no one shoe/shirt/hat size can fit all, then why should
    development processes be any different?
    37
    Saturday, 17 November 12

    View Slide

  123. ONE SIZE FITS ALL?
    • Scrum, Kanban, XP, Lean, Crystal... whatever...
    • TDD? BDD? Test first, or verify later?
    • If no one shoe/shirt/hat size can fit all, then why should
    development processes be any different?
    • There will always be people trying to sell you something.
    37
    Saturday, 17 November 12

    View Slide

  124. ONE SIZE FITS ALL?
    • Scrum, Kanban, XP, Lean, Crystal... whatever...
    • TDD? BDD? Test first, or verify later?
    • If no one shoe/shirt/hat size can fit all, then why should
    development processes be any different?
    • There will always be people trying to sell you something.
    • Use whatever works for your team, your project and your
    culture!
    37
    Saturday, 17 November 12

    View Slide

  125. Practice, Practice and Practice
    FAST TRACK
    38
    Saturday, 17 November 12

    View Slide

  126. CONTRIBUTE TO
    OPEN SOURCE PROJECTS
    39
    Saturday, 17 November 12

    View Slide

  127. CONTRIBUTE TO
    OPEN SOURCE PROJECTS
    • Reading code is just as important as writing code.
    阅读代码与编写代码同重要。
    39
    Saturday, 17 November 12

    View Slide

  128. CONTRIBUTE TO
    OPEN SOURCE PROJECTS
    • Reading code is just as important as writing code.
    阅读代码与编写代码同重要。
    • Learn from the masters.
    向⼤大师们学习。
    39
    Saturday, 17 November 12

    View Slide

  129. CONTRIBUTE TO
    OPEN SOURCE PROJECTS
    • Reading code is just as important as writing code.
    阅读代码与编写代码同重要。
    • Learn from the masters.
    向⼤大师们学习。
    • Take some, give some - sharing is awesome.
    不断收获的同时,别忘了付出。
    39
    Saturday, 17 November 12

    View Slide

  130. CONTRIBUTE TO
    OPEN SOURCE PROJECTS
    • Reading code is just as important as writing code.
    阅读代码与编写代码同重要。
    • Learn from the masters.
    向⼤大师们学习。
    • Take some, give some - sharing is awesome.
    不断收获的同时,别忘了付出。
    • Make things more useful for yourself therefore for others too.
    对⾃自⼰己有⽤用的东⻄西,也许对他⼈人也有⽤用。
    39
    Saturday, 17 November 12

    View Slide

  131. CONTRIBUTE TO
    OPEN SOURCE PROJECTS
    39
    Saturday, 17 November 12

    View Slide

  132. CONTRIBUTE TO
    OPEN SOURCE PROJECTS
    40
    Saturday, 17 November 12

    View Slide

  133. CONTRIBUTE TO
    OPEN SOURCE PROJECTS
    PHP CodeIgniter
    PHP Kohana
    PHP Vanilla Forums
    PHP Yii Framework
    JAVASCRIPT AutoSuggest
    RUBY Ruby on Rails
    RUBY RailsConfig
    RUBY Slim
    RUBY ORM Adapter
    RUBY Delayed Job
    RUBY Parallel Tests
    40
    Saturday, 17 November 12

    View Slide

  134. OPEN SOURCE
    YOUR OWN WORK
    41
    Saturday, 17 November 12

    View Slide

  135. OPEN SOURCE
    YOUR OWN WORK
    • Made something useful? Release it!
    写了有⽤用的好玩意⼉儿?发布吧,勇敢的少年!
    41
    Saturday, 17 November 12

    View Slide

  136. OPEN SOURCE
    YOUR OWN WORK
    • Made something useful? Release it!
    写了有⽤用的好玩意⼉儿?发布吧,勇敢的少年!
    • Be critisied of your work, and learn from mistakes.
    虚⼼心接受意⻅见与批评,由错误中学习。
    41
    Saturday, 17 November 12

    View Slide

  137. OPEN SOURCE
    YOUR OWN WORK
    • Made something useful? Release it!
    写了有⽤用的好玩意⼉儿?发布吧,勇敢的少年!
    • Be critisied of your work, and learn from mistakes.
    虚⼼心接受意⻅见与批评,由错误中学习。
    • Be proud of your work, and be recognised.
    为⾃自⼰己的⾟辛苦成果感到⾃自豪。
    41
    Saturday, 17 November 12

    View Slide

  138. OPEN SOURCE
    YOUR OWN WORK
    • Made something useful? Release it!
    写了有⽤用的好玩意⼉儿?发布吧,勇敢的少年!
    • Be critisied of your work, and learn from mistakes.
    虚⼼心接受意⻅见与批评,由错误中学习。
    • Be proud of your work, and be recognised.
    为⾃自⼰己的⾟辛苦成果感到⾃自豪。
    • Make a little dent in the universe.
    ⼀一点⼩小⼩小的贡献的话,可以哟〜~
    41
    Saturday, 17 November 12

    View Slide

  139. OPEN SOURCE
    YOUR OWN WORK
    41
    Saturday, 17 November 12

    View Slide

  140. OPEN SOURCE
    YOUR OWN WORK
    42
    Saturday, 17 November 12

    View Slide

  141. OPEN SOURCE
    YOUR OWN WORK
    RUBY Action Throttler Throttle actions based on configurable duration and limit.
    RUBY Angel Nest An open source 'clone' of AngelList.
    RUBY API Taster Visually test your Rails application's API.
    RUBY AppReset Resets (and if available, seeds) your databases.
    RUBY Bustle Activities recording and retrieving using a simple Pub/Sub-like interface.
    RUBY Datamappify Turn ActiveRecord into DataMapper (sort of)!
    RUBY Haml2Slim Convert Haml templates to Slim templates.
    RUBY Inherited Resources Views DRY your view files!
    RUBY Ruby Decorators Ruby method decorators inspired by Python.
    RUBY Security Guard A collection of useful tools for auditing data.
    RUBY Slim Bundle A Textmate / Sublime Text bundle for Slim.
    PHP Authlite A lightweight, flexible Auth module for Kohana.
    PHP KThrottler Throttle actions based on configurable duration and limit.
    PHP PHamlP A bridge between Kohana and PHamlP.
    JAVASCRIPT Endless Scroll Endless / infinite scrolling solution for jQuery.
    JAVASCRIPT Inline Confirmation Less obtrusive confirmation dialogues.
    JAVASCRIPT Skinny Coffee Machine A simple state machine with observers.
    JAVASCRIPT Slideshow Lite A lightweight slideshow plugin for jQuery.
    42
    Saturday, 17 November 12

    View Slide

  142. ISSUES AND
    CONVERSATIONS
    43
    Saturday, 17 November 12

    View Slide

  143. 44
    Saturday, 17 November 12

    View Slide

  144. Credit: travis-ci.com
    44
    Saturday, 17 November 12

    View Slide

  145. ANGEL NEST
    A real world example of a Rails project
    45
    Saturday, 17 November 12

    View Slide

  146. MADE HEADLINE NEWS
    46
    Saturday, 17 November 12

    View Slide

  147. 47
    Saturday, 17 November 12

    View Slide

  148. PUBLIC REACTIONS
    What did people say about this project?
    47
    Saturday, 17 November 12

    View Slide

  149. 48
    Saturday, 17 November 12

    View Slide

  150. Holy shit the code is clean. Good job dude.
    I'm impressed by your SCSS too. Good quality
    dev right here.
    -- dfischer (via Hacker News)
    48
    Saturday, 17 November 12

    View Slide

  151. 49
    Saturday, 17 November 12

    View Slide

  152. 50
    Saturday, 17 November 12

    View Slide

  153. 51
    Saturday, 17 November 12

    View Slide

  154. 52
    Saturday, 17 November 12

    View Slide

  155. ... he's turned a negative event (getting stiffed)
    into positive exposure for his work with
    hundreds of HN readers. At least at a glance, it
    seems like solid and clean Rails / Ruby code ...
    -- tomkarlo (via Hacker News)
    52
    Saturday, 17 November 12

    View Slide

  156. 53
    Saturday, 17 November 12

    View Slide

  157. I reviewed the angel_nest code and I must say
    it has the best implementation. Thank you very
    much for releasing angel_nest as open source.
    -- Firoz A. (via Email)
    53
    Saturday, 17 November 12

    View Slide

  158. https://github.com/fredwu/angel_nest
    54
    Saturday, 17 November 12

    View Slide

  159. SLIM
    A Case Study
    55
    Saturday, 17 November 12

    View Slide

  160. 56
    Saturday, 17 November 12

    View Slide

  161. 57
    Saturday, 17 November 12

    View Slide

  162. 57
    Saturday, 17 November 12

    View Slide

  163. 57
    Saturday, 17 November 12

    View Slide

  164. 58
    Saturday, 17 November 12

    View Slide

  165. 59
    Saturday, 17 November 12

    View Slide

  166. 60
    Saturday, 17 November 12

    View Slide

  167. 61
    Saturday, 17 November 12

    View Slide

  168. 62
    Saturday, 17 November 12

    View Slide

  169. 63
    Saturday, 17 November 12

    View Slide

  170. 64
    Saturday, 17 November 12

    View Slide

  171. 65
    Saturday, 17 November 12

    View Slide

  172. 66
    Saturday, 17 November 12

    View Slide

  173. 67
    Saturday, 17 November 12

    View Slide

  174. 68
    Saturday, 17 November 12

    View Slide

  175. 69
    Saturday, 17 November 12

    View Slide

  176. 70
    Saturday, 17 November 12

    View Slide

  177. 71
    Saturday, 17 November 12

    View Slide

  178. 72
    Saturday, 17 November 12

    View Slide

  179. 73
    Saturday, 17 November 12

    View Slide

  180. ... you have an impressive collection of open
    source contributions, and it would be great to
    keep in touch ...
    -- Tom Preston-Werner (CEO, GitHub)
    73
    Saturday, 17 November 12

    View Slide

  181. DO FREELANCE WORK
    74
    Saturday, 17 November 12

    View Slide

  182. DO FREELANCE WORK
    • Like open source work, but with deadlines and pressure.
    截⽌止期限与压⼒力。
    74
    Saturday, 17 November 12

    View Slide

  183. DO FREELANCE WORK
    • Like open source work, but with deadlines and pressure.
    截⽌止期限与压⼒力。
    • Like open source work, but with some $$$.
    赚点外快。
    74
    Saturday, 17 November 12

    View Slide

  184. DO FREELANCE WORK
    • Like open source work, but with deadlines and pressure.
    截⽌止期限与压⼒力。
    • Like open source work, but with some $$$.
    赚点外快。
    • Be involved in projects different to those at your day job.
    不同的项⺫⽬目体验与经验。
    74
    Saturday, 17 November 12

    View Slide

  185. DO FREELANCE WORK
    • Like open source work, but with deadlines and pressure.
    截⽌止期限与压⼒力。
    • Like open source work, but with some $$$.
    赚点外快。
    • Be involved in projects different to those at your day job.
    不同的项⺫⽬目体验与经验。
    • Communication skills with your clients.
    客户沟通经验。
    74
    Saturday, 17 November 12

    View Slide

  186. DO FREELANCE WORK
    • Like open source work, but with deadlines and pressure.
    截⽌止期限与压⼒力。
    • Like open source work, but with some $$$.
    赚点外快。
    • Be involved in projects different to those at your day job.
    不同的项⺫⽬目体验与经验。
    • Communication skills with your clients.
    客户沟通经验。
    • Communication skills with your remote team members.
    远程团队沟通经验。
    74
    Saturday, 17 November 12

    View Slide

  187. DO FREELANCE WORK
    74
    Saturday, 17 November 12

    View Slide

  188. DO FREELANCE WORK
    75
    Saturday, 17 November 12

    View Slide

  189. DO FREELANCE WORK
    PHP ESTILE (eCommerce)
    PHP P1.CN (social network)
    RUBY 2Threads (eCommerce)
    RUBY AppHelp! (web + mobile app)
    RUBY 500 Startups (online portal)
    RUBY TED City 2.0 (content platform)
    75
    Saturday, 17 November 12

    View Slide

  190. AND LASTLY,
    YOUR DAY JOB
    76
    Saturday, 17 November 12

    View Slide

  191. AND LASTLY,
    YOUR DAY JOB
    • You spend most of your hours awake at your day job, make it
    count!
    76
    Saturday, 17 November 12

    View Slide

  192. AND LASTLY,
    YOUR DAY JOB
    • You spend most of your hours awake at your day job, make it
    count!
    • Know what you are looking for.
    知道⾃自⼰己想要什么。
    76
    Saturday, 17 November 12

    View Slide

  193. AND LASTLY,
    YOUR DAY JOB
    • You spend most of your hours awake at your day job, make it
    count!
    • Know what you are looking for.
    知道⾃自⼰己想要什么。
    • What can you get out of working at the company?
    在这家公司⼯工作,能学习到什么?
    76
    Saturday, 17 November 12

    View Slide

  194. AND LASTLY,
    YOUR DAY JOB
    • You spend most of your hours awake at your day job, make it
    count!
    • Know what you are looking for.
    知道⾃自⼰己想要什么。
    • What can you get out of working at the company?
    在这家公司⼯工作,能学习到什么?
    • What did you get out of working at the company?
    在这家公司⼯工作,学习到了什么?
    76
    Saturday, 17 November 12

    View Slide

  195. AND LASTLY,
    YOUR DAY JOB
    76
    Saturday, 17 November 12

    View Slide

  196. AND LASTLY,
    YOUR DAY JOB
    ‣ Small web agency
    ‣ Mostly static websites
    ‣ Mostly small clients
    ‣ Mostly small projects
    77
    Saturday, 17 November 12

    View Slide

  197. AND LASTLY,
    YOUR DAY JOB
    • My first real job (part time)
    ‣ Small web agency
    ‣ Mostly static websites
    ‣ Mostly small clients
    ‣ Mostly small projects
    77
    Saturday, 17 November 12

    View Slide

  198. AND LASTLY,
    YOUR DAY JOB
    • My first real job (part time)
    • HTML, CSS, PHP and JavaScript!
    ‣ Small web agency
    ‣ Mostly static websites
    ‣ Mostly small clients
    ‣ Mostly small projects
    77
    Saturday, 17 November 12

    View Slide

  199. AND LASTLY,
    YOUR DAY JOB
    • My first real job (part time)
    • HTML, CSS, PHP and JavaScript!
    • Mostly worked by myself
    ‣ Small web agency
    ‣ Mostly static websites
    ‣ Mostly small clients
    ‣ Mostly small projects
    77
    Saturday, 17 November 12

    View Slide

  200. AND LASTLY,
    YOUR DAY JOB
    • My first real job (part time)
    • HTML, CSS, PHP and JavaScript!
    • Mostly worked by myself
    • Learnt a thing or two about SEO
    ‣ Small web agency
    ‣ Mostly static websites
    ‣ Mostly small clients
    ‣ Mostly small projects
    77
    Saturday, 17 November 12

    View Slide

  201. AND LASTLY,
    YOUR DAY JOB
    • My first real job (part time)
    • HTML, CSS, PHP and JavaScript!
    • Mostly worked by myself
    • Learnt a thing or two about SEO
    • I’m not as good as I thought I was
    ‣ Small web agency
    ‣ Mostly static websites
    ‣ Mostly small clients
    ‣ Mostly small projects
    77
    Saturday, 17 November 12

    View Slide

  202. AND LASTLY,
    YOUR DAY JOB
    ‣ Small agency (print + web)
    ‣ Small to mid-sized projects
    ‣ Household name clients
    ‣ Meetings with clients
    78
    Saturday, 17 November 12

    View Slide

  203. AND LASTLY,
    YOUR DAY JOB
    • My first full time job
    ‣ Small agency (print + web)
    ‣ Small to mid-sized projects
    ‣ Household name clients
    ‣ Meetings with clients
    78
    Saturday, 17 November 12

    View Slide

  204. AND LASTLY,
    YOUR DAY JOB
    • My first full time job
    • Mostly PHP and JavaScript
    ‣ Small agency (print + web)
    ‣ Small to mid-sized projects
    ‣ Household name clients
    ‣ Meetings with clients
    78
    Saturday, 17 November 12

    View Slide

  205. AND LASTLY,
    YOUR DAY JOB
    • My first full time job
    • Mostly PHP and JavaScript
    • Kohana, Zend Framework and Yii
    ‣ Small agency (print + web)
    ‣ Small to mid-sized projects
    ‣ Household name clients
    ‣ Meetings with clients
    78
    Saturday, 17 November 12

    View Slide

  206. AND LASTLY,
    YOUR DAY JOB
    • My first full time job
    • Mostly PHP and JavaScript
    • Kohana, Zend Framework and Yii
    • Team environment
    ‣ Small agency (print + web)
    ‣ Small to mid-sized projects
    ‣ Household name clients
    ‣ Meetings with clients
    78
    Saturday, 17 November 12

    View Slide

  207. AND LASTLY,
    YOUR DAY JOB
    • My first full time job
    • Mostly PHP and JavaScript
    • Kohana, Zend Framework and Yii
    • Team environment
    • Learnt things I didn’t know (print)
    ‣ Small agency (print + web)
    ‣ Small to mid-sized projects
    ‣ Household name clients
    ‣ Meetings with clients
    78
    Saturday, 17 November 12

    View Slide

  208. AND LASTLY,
    YOUR DAY JOB
    ‣ Well-known startup
    ‣ Great platforms and websites
    ‣ Online education!
    ‣ High traffic
    ‣ Ruby shop
    79
    Saturday, 17 November 12

    View Slide

  209. • Hired as a PHP developer
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well-known startup
    ‣ Great platforms and websites
    ‣ Online education!
    ‣ High traffic
    ‣ Ruby shop
    79
    Saturday, 17 November 12

    View Slide

  210. • Hired as a PHP developer
    • Became a Ruby developer
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well-known startup
    ‣ Great platforms and websites
    ‣ Online education!
    ‣ High traffic
    ‣ Ruby shop
    79
    Saturday, 17 November 12

    View Slide

  211. • Hired as a PHP developer
    • Became a Ruby developer
    • Learnt heaps from senior devs
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well-known startup
    ‣ Great platforms and websites
    ‣ Online education!
    ‣ High traffic
    ‣ Ruby shop
    79
    Saturday, 17 November 12

    View Slide

  212. • Hired as a PHP developer
    • Became a Ruby developer
    • Learnt heaps from senior devs
    • Manage stakeholder expectations
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well-known startup
    ‣ Great platforms and websites
    ‣ Online education!
    ‣ High traffic
    ‣ Ruby shop
    79
    Saturday, 17 November 12

    View Slide

  213. • Hired as a PHP developer
    • Became a Ruby developer
    • Learnt heaps from senior devs
    • Manage stakeholder expectations
    • Online education
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well-known startup
    ‣ Great platforms and websites
    ‣ Online education!
    ‣ High traffic
    ‣ Ruby shop
    79
    Saturday, 17 November 12

    View Slide

  214. • Hired as a PHP developer
    • Became a Ruby developer
    • Learnt heaps from senior devs
    • Manage stakeholder expectations
    • Online education
    • Recognisable brand
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well-known startup
    ‣ Great platforms and websites
    ‣ Online education!
    ‣ High traffic
    ‣ Ruby shop
    79
    Saturday, 17 November 12

    View Slide

  215. AND LASTLY,
    YOUR DAY JOB
    ‣ Well funded startup ($50M+)
    ‣ Large teams
    ‣ Multiple projects
    80
    Saturday, 17 November 12

    View Slide

  216. • Hired as a senior developer
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well funded startup ($50M+)
    ‣ Large teams
    ‣ Multiple projects
    80
    Saturday, 17 November 12

    View Slide

  217. • Hired as a senior developer
    • 40+ developers
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well funded startup ($50M+)
    ‣ Large teams
    ‣ Multiple projects
    80
    Saturday, 17 November 12

    View Slide

  218. • Hired as a senior developer
    • 40+ developers
    • My first agile environment!
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well funded startup ($50M+)
    ‣ Large teams
    ‣ Multiple projects
    80
    Saturday, 17 November 12

    View Slide

  219. • Hired as a senior developer
    • 40+ developers
    • My first agile environment!
    • Multiple teams and projects
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well funded startup ($50M+)
    ‣ Large teams
    ‣ Multiple projects
    80
    Saturday, 17 November 12

    View Slide

  220. • Hired as a senior developer
    • 40+ developers
    • My first agile environment!
    • Multiple teams and projects
    • Made lots of friends :-)
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well funded startup ($50M+)
    ‣ Large teams
    ‣ Multiple projects
    80
    Saturday, 17 November 12

    View Slide

  221. AND LASTLY,
    YOUR DAY JOB
    ‣ Well-known company
    ‣ Respected in the industry
    ‣ Online education!
    ‣ High traffic
    81
    Saturday, 17 November 12

    View Slide

  222. • Hired as a development team lead
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well-known company
    ‣ Respected in the industry
    ‣ Online education!
    ‣ High traffic
    81
    Saturday, 17 November 12

    View Slide

  223. • Hired as a development team lead
    • Tech leadership and management
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well-known company
    ‣ Respected in the industry
    ‣ Online education!
    ‣ High traffic
    81
    Saturday, 17 November 12

    View Slide

  224. • Hired as a development team lead
    • Tech leadership and management
    • Great industry connections
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well-known company
    ‣ Respected in the industry
    ‣ Online education!
    ‣ High traffic
    81
    Saturday, 17 November 12

    View Slide

  225. • Hired as a development team lead
    • Tech leadership and management
    • Great industry connections
    • Online education
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well-known company
    ‣ Respected in the industry
    ‣ Online education!
    ‣ High traffic
    81
    Saturday, 17 November 12

    View Slide

  226. • Hired as a development team lead
    • Tech leadership and management
    • Great industry connections
    • Online education
    • Recognisable brand
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well-known company
    ‣ Respected in the industry
    ‣ Online education!
    ‣ High traffic
    81
    Saturday, 17 November 12

    View Slide

  227. AND LASTLY,
    YOUR DAY JOB
    ‣ Well-funded startup
    ‣ Unique industry connections
    ‣ Early stage
    ‣ Big opportunities
    82
    Saturday, 17 November 12

    View Slide

  228. • Hired as a development team lead
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well-funded startup
    ‣ Unique industry connections
    ‣ Early stage
    ‣ Big opportunities
    82
    Saturday, 17 November 12

    View Slide

  229. • Hired as a development team lead
    • Design and architect systems
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well-funded startup
    ‣ Unique industry connections
    ‣ Early stage
    ‣ Big opportunities
    82
    Saturday, 17 November 12

    View Slide

  230. • Hired as a development team lead
    • Design and architect systems
    • Build champion teams
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well-funded startup
    ‣ Unique industry connections
    ‣ Early stage
    ‣ Big opportunities
    82
    Saturday, 17 November 12

    View Slide

  231. • Hired as a development team lead
    • Design and architect systems
    • Build champion teams
    • Enterprise products + startup spirits
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well-funded startup
    ‣ Unique industry connections
    ‣ Early stage
    ‣ Big opportunities
    82
    Saturday, 17 November 12

    View Slide

  232. • Hired as a development team lead
    • Design and architect systems
    • Build champion teams
    • Enterprise products + startup spirits
    • Be part of something big (potentially)
    AND LASTLY,
    YOUR DAY JOB
    ‣ Well-funded startup
    ‣ Unique industry connections
    ‣ Early stage
    ‣ Big opportunities
    82
    Saturday, 17 November 12

    View Slide

  233. PERSONAL BRANDING
    83
    Saturday, 17 November 12

    View Slide

  234. PERSONAL BRANDING
    • Designers have online portfolios, what about us developers?
    83
    Saturday, 17 November 12

    View Slide

  235. PERSONAL BRANDING
    • Designers have online portfolios, what about us developers?
    • Blog - show me your thoughts!
    83
    Saturday, 17 November 12

    View Slide

  236. PERSONAL BRANDING
    • Designers have online portfolios, what about us developers?
    • Blog - show me your thoughts!
    • Twitter/Weibo - show me your passion!
    83
    Saturday, 17 November 12

    View Slide

  237. PERSONAL BRANDING
    • Designers have online portfolios, what about us developers?
    • Blog - show me your thoughts!
    • Twitter/Weibo - show me your passion!
    • GitHub - show me your code!
    83
    Saturday, 17 November 12

    View Slide

  238. PERSONAL BRANDING
    • Designers have online portfolios, what about us developers?
    • Blog - show me your thoughts!
    • Twitter/Weibo - show me your passion!
    • GitHub - show me your code!
    • LinkedIn - show me your resume!
    83
    Saturday, 17 November 12

    View Slide

  239. PERSONAL BRANDING
    84
    Saturday, 17 November 12

    View Slide

  240. PERSONAL BRANDING
    • Build up your network
    拓展交际圈
    • Establish your reputation
    树⽴立好名声
    • People will endorse your
    work
    让更多⼈人赞誉你的成果
    84
    Saturday, 17 November 12

    View Slide

  241. 85
    Saturday, 17 November 12

    View Slide

  242. Most importantly...
    85
    Saturday, 17 November 12

    View Slide

  243. LET PEOPLE REMEMBER YOU!
    Most importantly...
    85
    Saturday, 17 November 12

    View Slide

  244. 86
    Saturday, 17 November 12

    View Slide

  245. We can talk the talk
    86
    Saturday, 17 November 12

    View Slide

  246. LET’S WALK THE WALK
    We can talk the talk
    86
    Saturday, 17 November 12

    View Slide

  247. GIT
    87
    Saturday, 17 November 12

    View Slide

  248. GIT
    • Merge vs Rebase vs Squash
    • GitHub
    87
    Saturday, 17 November 12

    View Slide

  249. PRETTIFY YOUR
    COMMAND PROMPT
    88
    Saturday, 17 November 12

    View Slide

  250. PRETTIFY YOUR
    COMMAND PROMPT
    88
    Saturday, 17 November 12

    View Slide

  251. PRETTIFY YOUR
    COMMAND PROMPT
    88
    Saturday, 17 November 12

    View Slide

  252. PRETTIFY YOUR
    COMMAND PROMPT
    88
    Saturday, 17 November 12

    View Slide

  253. PRETTIFY YOUR
    COMMAND PROMPT
    88
    Saturday, 17 November 12

    View Slide

  254. PRETTIFY YOUR
    COMMAND PROMPT
    88
    Saturday, 17 November 12

    View Slide

  255. OH-MY-ZSH
    HTTPS://GITHUB.COM/ROBBYRUSSELL/OH-MY-ZSH
    89
    Saturday, 17 November 12

    View Slide

  256. 90
    Saturday, 17 November 12

    View Slide

  257. PLEASE MAKE USE OF
    ALIASES
    91
    Saturday, 17 November 12

    View Slide

  258. JANUS - VIM FOR THE REST OF US
    https://github.com/carlhuda/janus
    92
    Saturday, 17 November 12

    View Slide

  259. OUR GIT WORKFLOW
    93
    Saturday, 17 November 12

    View Slide

  260. OUR GIT WORKFLOW
    • Two deployable branches - “master” and “develop”
    93
    Saturday, 17 November 12

    View Slide

  261. OUR GIT WORKFLOW
    • Two deployable branches - “master” and “develop”
    • Both branches connect to CI (Jenkins + Travis)
    93
    Saturday, 17 November 12

    View Slide

  262. OUR GIT WORKFLOW
    • Two deployable branches - “master” and “develop”
    • Both branches connect to CI (Jenkins + Travis)
    • Small tweaks and hot-fixes push to deployable branches directly
    93
    Saturday, 17 November 12

    View Slide

  263. OUR GIT WORKFLOW
    • Two deployable branches - “master” and “develop”
    • Both branches connect to CI (Jenkins + Travis)
    • Small tweaks and hot-fixes push to deployable branches directly
    • Disposable feature branches
    93
    Saturday, 17 November 12

    View Slide

  264. OUR GIT WORKFLOW
    • Two deployable branches - “master” and “develop”
    • Both branches connect to CI (Jenkins + Travis)
    • Small tweaks and hot-fixes push to deployable branches directly
    • Disposable feature branches
    • Pull requests (w/ Travis)
    93
    Saturday, 17 November 12

    View Slide

  265. OUR GIT WORKFLOW
    • Two deployable branches - “master” and “develop”
    • Both branches connect to CI (Jenkins + Travis)
    • Small tweaks and hot-fixes push to deployable branches directly
    • Disposable feature branches
    • Pull requests (w/ Travis)
    • Pull requests get reviewed
    93
    Saturday, 17 November 12

    View Slide

  266. OUR GIT WORKFLOW
    • Two deployable branches - “master” and “develop”
    • Both branches connect to CI (Jenkins + Travis)
    • Small tweaks and hot-fixes push to deployable branches directly
    • Disposable feature branches
    • Pull requests (w/ Travis)
    • Pull requests get reviewed
    • Pull requests get merged
    93
    Saturday, 17 November 12

    View Slide

  267. OUR GIT WORKFLOW
    • Two deployable branches - “master” and “develop”
    • Both branches connect to CI (Jenkins + Travis)
    • Small tweaks and hot-fixes push to deployable branches directly
    • Disposable feature branches
    • Pull requests (w/ Travis)
    • Pull requests get reviewed
    • Pull requests get merged
    • Release and profit!
    93
    Saturday, 17 November 12

    View Slide

  268. CODE REVIEW
    94
    Saturday, 17 November 12

    View Slide

  269. CODE REVIEW
    • Test coverage - SimpleCov https://github.com/colszowka/simplecov
    94
    Saturday, 17 November 12

    View Slide

  270. CODE REVIEW
    • Test coverage - SimpleCov https://github.com/colszowka/simplecov
    • Code quality measurement - Cane https://github.com/square/cane
    94
    Saturday, 17 November 12

    View Slide

  271. CODE REVIEW
    95
    Saturday, 17 November 12

    View Slide

  272. CODE REVIEW
    • Pairing
    95
    Saturday, 17 November 12

    View Slide

  273. CODE REVIEW
    • Pairing
    • GitHub pull requests
    95
    Saturday, 17 November 12

    View Slide

  274. CONTINUOUS INTEGRATION
    AND DEPLOYMENT
    96
    Saturday, 17 November 12

    View Slide

  275. CONTINUOUS INTEGRATION
    AND DEPLOYMENT
    Profile
    Repo Git Push
    96
    Saturday, 17 November 12

    View Slide

  276. CONTINUOUS INTEGRATION
    AND DEPLOYMENT
    Profile
    Repo Git Push
    Profile CI
    96
    Saturday, 17 November 12

    View Slide

  277. CONTINUOUS INTEGRATION
    AND DEPLOYMENT
    Profile
    Repo Git Push
    Platform
    Repo Git Push
    Profile CI
    96
    Saturday, 17 November 12

    View Slide

  278. CONTINUOUS INTEGRATION
    AND DEPLOYMENT
    Profile
    Repo Git Push
    Platform
    Repo Git Push
    Profile CI
    Platform CI
    96
    Saturday, 17 November 12

    View Slide

  279. CONTINUOUS INTEGRATION
    AND DEPLOYMENT
    Profile
    Repo Git Push
    Platform
    Repo Git Push
    Profile CI
    Platform CI
    Integration CI
    96
    Saturday, 17 November 12

    View Slide

  280. CONTINUOUS INTEGRATION
    AND DEPLOYMENT
    Profile
    Repo Git Push
    Platform
    Repo Git Push
    Profile CI
    Platform CI
    Integration CI
    Profile
    Staging
    Platform
    Staging
    96
    Saturday, 17 November 12

    View Slide

  281. CONTINUOUS INTEGRATION
    AND DEPLOYMENT
    Profile
    Repo Git Push
    Platform
    Repo Git Push
    Profile CI
    Platform CI
    Integration CI
    Scraper
    Repo Git Push
    Profile
    Staging
    Platform
    Staging
    96
    Saturday, 17 November 12

    View Slide

  282. CONTINUOUS INTEGRATION
    AND DEPLOYMENT
    Profile
    Repo Git Push
    Platform
    Repo Git Push
    Profile CI
    Platform CI
    Integration CI
    Scraper
    Repo Git Push
    Scraper CI
    Profile
    Staging
    Platform
    Staging
    96
    Saturday, 17 November 12

    View Slide

  283. CONTINUOUS INTEGRATION
    AND DEPLOYMENT
    Profile
    Repo Git Push
    Platform
    Repo Git Push
    Profile CI
    Platform CI
    Integration CI
    Scraper
    Repo Git Push
    Scraper
    Cron Job
    Scraper CI
    Profile
    Staging
    Platform
    Staging
    96
    Saturday, 17 November 12

    View Slide

  284. CONTINUOUS INTEGRATION
    AND DEPLOYMENT
    Profile
    Repo Git Push
    Platform
    Repo Git Push
    Profile CI
    Platform CI
    Integration CI
    Scraper
    Repo Git Push
    Scraper
    Cron Job
    Scraper
    Staging
    Scraper CI
    Profile
    Staging
    Platform
    Staging
    96
    Saturday, 17 November 12

    View Slide

  285. QUICK START
    97
    Saturday, 17 November 12

    View Slide

  286. QUICK START
    • Start developing should be simple:
    97
    Saturday, 17 November 12

    View Slide

  287. QUICK START
    • Start developing should be simple:
    • git checkout url_to_the_repo
    97
    Saturday, 17 November 12

    View Slide

  288. QUICK START
    • Start developing should be simple:
    • git checkout url_to_the_repo
    • bundle
    97
    Saturday, 17 November 12

    View Slide

  289. QUICK START
    • Start developing should be simple:
    • git checkout url_to_the_repo
    • bundle
    • rake app:reset
    97
    Saturday, 17 November 12

    View Slide

  290. QUICK START
    • Start developing should be simple:
    • git checkout url_to_the_repo
    • bundle
    • rake app:reset
    • rails server
    97
    Saturday, 17 November 12

    View Slide

  291. QUICK START
    • Start developing should be simple:
    • git checkout url_to_the_repo
    • bundle
    • rake app:reset
    • rails server
    • Use Foreman for processes https://github.com/ddollar/foreman
    97
    Saturday, 17 November 12

    View Slide

  292. QUICK START
    97
    Saturday, 17 November 12

    View Slide

  293. QUICK START
    98
    Saturday, 17 November 12

    View Slide

  294. QUICK START
    98
    Saturday, 17 November 12

    View Slide

  295. WHEN IN DOUBT
    READ THE SOURCE CODE
    99
    Saturday, 17 November 12

    View Slide

  296. WHEN IN DOUBT
    READ THE SOURCE CODE
    100
    Saturday, 17 November 12

    View Slide

  297. WHEN IN DOUBT
    READ THE SOURCE CODE
    100
    Saturday, 17 November 12

    View Slide

  298. 101
    Saturday, 17 November 12

    View Slide

  299. How about a fun little task...
    101
    Saturday, 17 November 12

    View Slide

  300. A SMALL CODE TEST
    How about a fun little task...
    101
    Saturday, 17 November 12

    View Slide

  301. 102
    Saturday, 17 November 12

    View Slide

  302. 102
    Saturday, 17 November 12

    View Slide

  303. 102
    Saturday, 17 November 12

    View Slide

  304. 102
    Saturday, 17 November 12

    View Slide

  305. A BAD SOLUTION
    103
    Saturday, 17 November 12

    View Slide

  306. A BAD SOLUTION
    104
    Saturday, 17 November 12

    View Slide

  307. ANOTHER BAD SOLUTION
    105
    Saturday, 17 November 12

    View Slide

  308. ANOTHER BAD SOLUTION
    106
    Saturday, 17 November 12

    View Slide

  309. A GOOD SOLUTION
    107
    Saturday, 17 November 12

    View Slide

  310. A GOOD SOLUTION
    108
    Saturday, 17 November 12

    View Slide

  311. ANOTHER GOOD SOLUTION
    109
    Saturday, 17 November 12

    View Slide

  312. ANOTHER GOOD SOLUTION
    110
    Saturday, 17 November 12

    View Slide

  313. 111
    Saturday, 17 November 12

    View Slide

  314. And behold, for a solution that...
    111
    Saturday, 17 November 12

    View Slide

  315. BLOWS YOUR MIND ޵䙽੧໨ʂ
    And behold, for a solution that...
    111
    Saturday, 17 November 12

    View Slide

  316. A 坑爹 SOLUTION
    112
    Saturday, 17 November 12

    View Slide

  317. A 坑爹 SOLUTION
    113
    Saturday, 17 November 12

    View Slide

  318. A 坑爹 SOLUTION
    113
    Saturday, 17 November 12

    View Slide

  319. A 坑爹 SOLUTION
    114
    Saturday, 17 November 12

    View Slide

  320. A 坑爹 SOLUTION
    你妹啊!
    114
    Saturday, 17 November 12

    View Slide

  321. 115
    Saturday, 17 November 12

    View Slide

  322. WTF?!
    And, sometimes you’ll get a weird one ...
    115
    Saturday, 17 November 12

    View Slide

  323. “THIS IS A WELL-KNOWN
    MARS ROVER QUESTION.”
    116
    Saturday, 17 November 12

    View Slide

  324. “THIS IS A WELL-KNOWN
    MARS ROVER QUESTION.”
    你妹啊!
    116
    Saturday, 17 November 12

    View Slide

  325. 117
    Saturday, 17 November 12

    View Slide

  326. CHEAT
    And, once in a while, someone will attempt to ...
    117
    Saturday, 17 November 12

    View Slide

  327. 118
    Saturday, 17 November 12

    View Slide

  328. Thank you for informed me. I am writing to apologise the sloppy
    code. There was an unexpected house selling emergency last
    weekend. I was unable to spent enough time on the test. Your
    Agency is important to me, I value each opportunity you brought
    and always prepare it seriously. Please accept my sincere apology for
    missing this valuable job opportunity.
    -- Candidate who cheats
    118
    Saturday, 17 November 12

    View Slide

  329. Thank you for informed me. I am writing to apologise the sloppy
    code. There was an unexpected house selling emergency last
    weekend. I was unable to spent enough time on the test. Your
    Agency is important to me, I value each opportunity you brought
    and always prepare it seriously. Please accept my sincere apology for
    missing this valuable job opportunity.
    -- Candidate who cheats
    118
    Saturday, 17 November 12

    View Slide

  330. Thank you for informed me. I am writing to apologise the sloppy
    code. There was an unexpected house selling emergency last
    weekend. I was unable to spent enough time on the test. Your
    Agency is important to me, I value each opportunity you brought
    and always prepare it seriously. Please accept my sincere apology for
    missing this valuable job opportunity.
    -- Candidate who cheats
    118
    Saturday, 17 November 12

    View Slide

  331. Thank you for informed me. I am writing to apologise the sloppy
    code. There was an unexpected house selling emergency last
    weekend. I was unable to spent enough time on the test. Your
    Agency is important to me, I value each opportunity you brought
    and always prepare it seriously. Please accept my sincere apology for
    missing this valuable job opportunity.
    -- Candidate who cheats
    118
    Saturday, 17 November 12

    View Slide

  332. 119
    Saturday, 17 November 12

    View Slide

  333. Writing features is (usually) not enough...
    119
    Saturday, 17 November 12

    View Slide

  334. WE NEED TESTS!
    Writing features is (usually) not enough...
    119
    Saturday, 17 November 12

    View Slide

  335. 120
    Saturday, 17 November 12

    View Slide

  336. “I get paid for code that works, not for tests,
    so my philosophy is to test as little as possible
    to reach a given level of confidence.”
    -- Kent Beck
    120
    Saturday, 17 November 12

    View Slide

  337. TDD != TEST FIRST
    121
    Saturday, 17 November 12

    View Slide

  338. EFFECTIVE TESTS
    122
    Saturday, 17 November 12

    View Slide

  339. EFFECTIVE TESTS
    122
    Saturday, 17 November 12

    View Slide

  340. EFFECTIVE TESTS
    • They are describing
    ActiveRecord behaviours.
    122
    Saturday, 17 November 12

    View Slide

  341. EFFECTIVE TESTS
    • They are describing
    ActiveRecord behaviours.
    • Allow mass assignments
    on foreign keys is wrong.
    122
    Saturday, 17 November 12

    View Slide

  342. EFFECTIVE TESTS
    • They are describing
    ActiveRecord behaviours.
    • Allow mass assignments
    on foreign keys is wrong.
    • They are testing how
    methods are implemented.
    122
    Saturday, 17 November 12

    View Slide

  343. EFFECTIVE TESTS
    • They are describing
    ActiveRecord behaviours.
    • Allow mass assignments
    on foreign keys is wrong.
    • They are testing how
    methods are implemented.
    • No confidence gained.
    122
    Saturday, 17 November 12

    View Slide

  344. TEST WTFS
    • What are these “tests” actually testing?
    123
    Saturday, 17 November 12

    View Slide

  345. TEST WTFS
    • What are these “tests” actually testing?
    123
    Saturday, 17 November 12

    View Slide

  346. TEST WTFS
    • What are these “tests” actually testing?
    123
    Saturday, 17 November 12

    View Slide

  347. DE-DUPLICATE
    TEST CASES
    124
    Saturday, 17 November 12

    View Slide

  348. DE-DUPLICATE
    TEST CASES
    125
    Saturday, 17 November 12

    View Slide

  349. DE-DUPLICATE
    TEST CASES
    125
    Saturday, 17 November 12

    View Slide

  350. DE-DUPLICATE
    TEST CASES
    125
    Saturday, 17 November 12

    View Slide

  351. DE-DUPLICATE
    TEST CASES
    125
    Saturday, 17 November 12

    View Slide

  352. FASTER TESTS
    126
    Saturday, 17 November 12

    View Slide

  353. FASTER TESTS
    • For objects that don’t matter, use mocks (but don’t abuse ‘em!)
    ⽆无关紧要的对象们使⽤用 mock 就可以了,但切勿滥⽤用!
    126
    Saturday, 17 November 12

    View Slide

  354. FASTER TESTS
    • For objects that don’t matter, use mocks (but don’t abuse ‘em!)
    ⽆无关紧要的对象们使⽤用 mock 就可以了,但切勿滥⽤用!
    • When use factories, favour build to create
    使⽤用对象⼯工⼚厂的话,尽量使⽤用 build ⽽而⾮非 create
    126
    Saturday, 17 November 12

    View Slide

  355. FASTER TESTS
    • For objects that don’t matter, use mocks (but don’t abuse ‘em!)
    ⽆无关紧要的对象们使⽤用 mock 就可以了,但切勿滥⽤用!
    • When use factories, favour build to create
    使⽤用对象⼯工⼚厂的话,尽量使⽤用 build ⽽而⾮非 create
    • In-memory SQLite instead of MySQL/PostgresSQL
    可以的话,测试时使⽤用 SQLite 的内存储存
    126
    Saturday, 17 November 12

    View Slide

  356. FASTER TESTS
    • For objects that don’t matter, use mocks (but don’t abuse ‘em!)
    ⽆无关紧要的对象们使⽤用 mock 就可以了,但切勿滥⽤用!
    • When use factories, favour build to create
    使⽤用对象⼯工⼚厂的话,尽量使⽤用 build ⽽而⾮非 create
    • In-memory SQLite instead of MySQL/PostgresSQL
    可以的话,测试时使⽤用 SQLite 的内存储存
    • gem install slurp
    126
    Saturday, 17 November 12

    View Slide

  357. REFACTOR
    WITH CONFIDENCE
    127
    Saturday, 17 November 12

    View Slide

  358. REFACTOR
    WITH CONFIDENCE
    127
    Saturday, 17 November 12

    View Slide

  359. REFACTOR IN THE WILD
    Improve code readability and maintainability
    128
    Saturday, 17 November 12

    View Slide

  360. A SIMPLE EXAMPLE
    129
    Saturday, 17 November 12

    View Slide

  361. 130
    Saturday, 17 November 12

    View Slide

  362. 130
    Saturday, 17 November 12

    View Slide

  363. 130
    Saturday, 17 November 12

    View Slide

  364. KEEP CONTROLLERS CLEAN
    131
    Saturday, 17 November 12

    View Slide

  365. 132
    Saturday, 17 November 12

    View Slide

  366. 132
    Saturday, 17 November 12

    View Slide

  367. 132
    Saturday, 17 November 12

    View Slide

  368. 132
    Saturday, 17 November 12

    View Slide

  369. 132
    Saturday, 17 November 12

    View Slide

  370. 133
    Saturday, 17 November 12

    View Slide

  371. A MORE COMPLETE EXAMPLE
    134
    Saturday, 17 November 12

    View Slide

  372. PROBLEM
    135
    Saturday, 17 November 12

    View Slide

  373. PROBLEM
    • A user has many trips
    135
    Saturday, 17 November 12

    View Slide

  374. PROBLEM
    • A user has many trips
    • Each trip may contain more than one stops, e.g.
    • Beijing -> Shanghai
    • Shanghai -> Hongkong
    135
    Saturday, 17 November 12

    View Slide

  375. PROBLEM
    • A user has many trips
    • Each trip may contain more than one stops, e.g.
    • Beijing -> Shanghai
    • Shanghai -> Hongkong
    • We only want to display the first stop from each trip
    135
    Saturday, 17 November 12

    View Slide

  376. 136
    Saturday, 17 November 12

    View Slide

  377. 136
    Saturday, 17 November 12

    View Slide

  378. 136
    Saturday, 17 November 12

    View Slide

  379. 136
    Saturday, 17 November 12

    View Slide

  380. 136
    Saturday, 17 November 12

    View Slide

  381. 136
    Saturday, 17 November 12

    View Slide

  382. 136
    Saturday, 17 November 12

    View Slide

  383. 136
    Saturday, 17 November 12

    View Slide

  384. 136
    Saturday, 17 November 12

    View Slide

  385. 137
    Saturday, 17 November 12

    View Slide

  386. 137
    Saturday, 17 November 12

    View Slide

  387. 138
    Saturday, 17 November 12

    View Slide

  388. 138
    Saturday, 17 November 12

    View Slide

  389. A RUBY-CHINA EXAMPLE
    Albeit an old example, but nonetheless...
    139
    Saturday, 17 November 12

    View Slide

  390. 140
    Saturday, 17 November 12

    View Slide

  391. 140
    Saturday, 17 November 12

    View Slide

  392. 140
    Saturday, 17 November 12

    View Slide

  393. 140
    Saturday, 17 November 12

    View Slide

  394. 140
    Saturday, 17 November 12

    View Slide

  395. 141
    Saturday, 17 November 12

    View Slide

  396. 142
    Saturday, 17 November 12

    View Slide

  397. REFACTOR + OPEN SOURCE
    143
    Saturday, 17 November 12

    View Slide

  398. IDENTIFY THE ISSUE
    144
    Saturday, 17 November 12

    View Slide

  399. IDENTIFY THE ISSUE
    144
    Saturday, 17 November 12

    View Slide

  400. ATTEMPT TO REFACTOR
    145
    Saturday, 17 November 12

    View Slide

  401. ATTEMPT TO REFACTOR
    145
    Saturday, 17 November 12

    View Slide

  402. ENCOUNTER
    UNEXPECTED PROBLEM
    146
    Saturday, 17 November 12

    View Slide

  403. ENSURE CODE INTEGRITY
    147
    Saturday, 17 November 12

    View Slide

  404. VERIFY THE ISSUE ELSEWHERE
    148
    Saturday, 17 November 12

    View Slide

  405. BEGIN DEBUGGING...
    149
    Saturday, 17 November 12

    View Slide

  406. TRACK DOWN THE CAUSE
    150
    Saturday, 17 November 12

    View Slide

  407. TRACK DOWN THE CAUSE
    150
    Saturday, 17 November 12

    View Slide

  408. FIX IT!
    151
    Saturday, 17 November 12

    View Slide

  409. FIX IT!
    151
    Saturday, 17 November 12

    View Slide

  410. ENSURE IT ACTUALLY WORKS
    152
    Saturday, 17 November 12

    View Slide

  411. ENSURE IT ACTUALLY WORKS
    152
    Saturday, 17 November 12

    View Slide

  412. ENSURE IT DIDN’T
    BREAK ANYTHING
    153
    Saturday, 17 November 12

    View Slide

  413. PULL REQUEST
    154
    Saturday, 17 November 12

    View Slide

  414. 155
    Saturday, 17 November 12

    View Slide

  415. “There are only two hard things in Computer
    Science: cache invalidation and naming things.”
    -- Phil Karlton
    155
    Saturday, 17 November 12

    View Slide

  416. Approval
    User Role
    ?
    156
    Saturday, 17 November 12

    View Slide

  417. Approval
    User Role
    UserApproval
    157
    Saturday, 17 November 12

    View Slide

  418. PROBLEM WITH
    “UserApproval”
    158
    Saturday, 17 November 12

    View Slide

  419. PROBLEM WITH
    “UserApproval”
    • What does it mean?
    158
    Saturday, 17 November 12

    View Slide

  420. PROBLEM WITH
    “UserApproval”
    • What does it mean?
    • A user’s approval? Nope.
    158
    Saturday, 17 November 12

    View Slide

  421. PROBLEM WITH
    “UserApproval”
    • What does it mean?
    • A user’s approval? Nope.
    • An approval’s user? Nope.
    158
    Saturday, 17 November 12

    View Slide

  422. PROBLEM WITH
    “UserApproval”
    • What does it mean?
    • A user’s approval? Nope.
    • An approval’s user? Nope.
    • So, it’s not an approval, or a user.
    158
    Saturday, 17 November 12

    View Slide

  423. PROBLEM WITH
    “UserApproval”
    • What does it mean?
    • A user’s approval? Nope.
    • An approval’s user? Nope.
    • So, it’s not an approval, or a user.
    • Where’s the indication of “role”?
    158
    Saturday, 17 November 12

    View Slide

  424. Approval
    User Role
    ?
    159
    Saturday, 17 November 12

    View Slide

  425. Approval
    User Role
    Stakeholder
    160
    Saturday, 17 November 12

    View Slide

  426. UserApproval vs Stakeholder
    161
    Saturday, 17 November 12

    View Slide

  427. EMBRACE RUBY
    We are a fortunate bunch.
    162
    Saturday, 17 November 12

    View Slide

  428. 163
    Saturday, 17 November 12

    View Slide

  429. This portion of the slide is intentionally left blank.
    One function?!
    164
    Saturday, 17 November 12

    View Slide

  430. MORE RESOURCES
    Learn, Learn and Learn
    165
    Saturday, 17 November 12

    View Slide

  431. RAILSCASTS.COM
    166
    Saturday, 17 November 12

    View Slide

  432. PEEPCODE.COM
    167
    Saturday, 17 November 12

    View Slide

  433. DESTROYALLSOFTWARE.COM
    168
    Saturday, 17 November 12

    View Slide

  434. CONFREAKS.COM
    169
    Saturday, 17 November 12

    View Slide

  435. THECHANGELOG.COM
    170
    Saturday, 17 November 12

    View Slide

  436. CODESCHOOL.COM
    171
    Saturday, 17 November 12

    View Slide

  437. RUBYINSIDE.COM
    172
    Saturday, 17 November 12

    View Slide

  438. RUBYFLOW.COM
    173
    Saturday, 17 November 12

    View Slide

  439. RUBYWEEKLY.COM
    174
    Saturday, 17 November 12

    View Slide

  440. NET.TUTSPLUS.COM
    175
    Saturday, 17 November 12

    View Slide

  441. RUBYSOURCE.COM
    176
    Saturday, 17 November 12

    View Slide

  442. NEWS.YCOMBINATOR.COM
    177
    Saturday, 17 November 12

    View Slide

  443. THANK YOU!
    :-)
    178
    Saturday, 17 November 12

    View Slide