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

2735068c913a072744a799e3c0833b7b?s=47 Fred Wu
November 17, 2012

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

2735068c913a072744a799e3c0833b7b?s=128

Fred Wu

November 17, 2012
Tweet

Transcript

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

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

    17 November 12
  3. MY BACKGROUND 3 Saturday, 17 November 12

  4. 4 Saturday, 17 November 12

  5. 4 Saturday, 17 November 12

  6. • 1997 Got my first computer (Intel Pentium MMX 166Mhz)

    4 Saturday, 17 November 12
  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
  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
  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
  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
  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
  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
  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
  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
  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
  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
  17. AUSTRALIA HAS A STRONG RUBY COMMUNITY 5 Saturday, 17 November

    12
  18. 6 Saturday, 17 November 12

  19. 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 6 Saturday, 17 November 12
  20. DISCLAIMER I am still a n00b. ⼩小⼩小菜⻦鸟。 But I care,

    so I share. 抛砖引⽟玉。 7 Saturday, 17 November 12
  21. THOUGHTS ON SOFTWARE DEVELOPMENT 8 Saturday, 17 November 12

  22. THOUGHTS ON SOFTWARE DEVELOPMENT • Second system syndrome - avoid

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

    total rewrites. 第⼆二系统综合症——避免重写。 • Software engineering is like playing Starcraft - always check your mini-map. 软件⼯工程有如星际争霸——需经常关注迷你地图,以⼤大局为重。 8 Saturday, 17 November 12
  24. 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. 经验与天赋同重要。 8 Saturday, 17 November 12
  25. 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. 技术债务——拖⽋欠越久,偿还越多。 8 Saturday, 17 November 12
  26. 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. 谨慎选择软件架构。 8 Saturday, 17 November 12
  27. APPLICATION ARCHITECTURE SHOWCASE 9 Saturday, 17 November 12

  28. APPLICATION ARCHITECTURE SHOWCASE • We need a profile system to

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

    hold user data. ⽤用户帐户系统。 • The profile system will potentially be used standalone. ⽤用户帐户系统未来可能会被独⽴立使⽤用。 9 Saturday, 17 November 12
  30. 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”. 需可插⼊入式模块系统。 9 Saturday, 17 November 12
  31. 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. 未来可能会有第三⽅方开发的模块。 9 Saturday, 17 November 12
  32. 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. 开发周期很紧凑。 9 Saturday, 17 November 12
  33. SOLUTION I THE PERFECT WAY Profile (API) Platform Module Module

    Module 10 Saturday, 17 November 12
  34. PERFECT? NO! 11 Saturday, 17 November 12

  35. PERFECT? NO! • Longer development time. 开发周期过⻓长。 11 Saturday, 17

    November 12
  36. PERFECT? NO! • Longer development time. 开发周期过⻓长。 • Can’t guarantee

    the usefulness of the API layer for 3rd party developers. 不可预知 API 层在未来是否还可有效利⽤用。 11 Saturday, 17 November 12
  37. 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. 系统越复杂,越容易出错。 11 Saturday, 17 November 12
  38. SOLUTION II THE EASY WAY Platform Profile Module Module Module

    12 Saturday, 17 November 12
  39. EASY, BUT FOR HOW LONG? 13 Saturday, 17 November 12

  40. EASY, BUT FOR HOW LONG? • One app is more

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

    difficult to scale out. 单⼀一系统相对较难向外扩展。 • It is also more difficult to assign tasks. 单⼀一系统相对较难安排团队成员任务。 13 Saturday, 17 November 12
  42. 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. 单⼀一系统相对更难有效封装。 13 Saturday, 17 November 12
  43. SOLUTION III THE CHOSEN WAY Profile (API) Platform Module Module

    Module 14 Saturday, 17 November 12
  44. A BALANCED SOLUTION IS A GOOD SOLUTION 15 Saturday, 17

    November 12
  45. A BALANCED SOLUTION IS A GOOD SOLUTION • Don’t over-engineer.

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

    避免过度⼯工程。 • Good degree of separation of concern. 注重关注点分离。 15 Saturday, 17 November 12
  47. 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 15 Saturday, 17 November 12
  48. OOPS! 16 Saturday, 17 November 12

  49. OOPS! 17 Saturday, 17 November 12

  50. CRAP PRINCIPLES 18 Saturday, 17 November 12

  51. 19 Saturday, 17 November 12

  52. Contrast 对⽐比度 19 Saturday, 17 November 12

  53. Contrast 对⽐比度 Repetition 重复度 19 Saturday, 17 November 12

  54. Contrast 对⽐比度 Repetition 重复度 Alignment 排列度 19 Saturday, 17 November

    12
  55. Contrast 对⽐比度 Repetition 重复度 Alignment 排列度 Proximity 接近度 19 Saturday,

    17 November 12
  56. SOLID PRINCIPLES 20 Saturday, 17 November 12

  57. 21 Saturday, 17 November 12

  58. Single responsibility 单⼀一责任 21 Saturday, 17 November 12

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

  60. Single responsibility 单⼀一责任 Open/close 开闭 Liskov substitution ⾥里⽒氏替换 21 Saturday,

    17 November 12
  61. Single responsibility 单⼀一责任 Open/close 开闭 Liskov substitution ⾥里⽒氏替换 Interface segregation

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

    接⼝口分离 Dependency inversion 依赖倒置 21 Saturday, 17 November 12
  63. FOUR SIMPLE RULES 22 Saturday, 17 November 12

  64. 23 Saturday, 17 November 12

  65. Passes all the tests. 23 Saturday, 17 November 12

  66. Passes all the tests. Contains no duplication. 23 Saturday, 17

    November 12
  67. Passes all the tests. Contains no duplication. Expresses the intent.

    23 Saturday, 17 November 12
  68. Passes all the tests. Contains no duplication. Expresses the intent.

    Minimises the number of classes and methods. 23 Saturday, 17 November 12
  69. Until you have learnt Ruby first. DO NOT LEARN RAILS

    24 Saturday, 17 November 12
  70. Practice, Practice and Practice FAST TRACK 25 Saturday, 17 November

    12
  71. CONTRIBUTE TO OPEN SOURCE PROJECTS 26 Saturday, 17 November 12

  72. CONTRIBUTE TO OPEN SOURCE PROJECTS • Reading code is just

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

    as important as writing code. 阅读代码与编写代码同重要。 • Learn from the masters. 向⼤大师们学习。 26 Saturday, 17 November 12
  74. 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. 不断收获的同时,别忘了付出。 26 Saturday, 17 November 12
  75. 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. 对⾃自⼰己有⽤用的东⻄西,也许对他⼈人也有⽤用。 26 Saturday, 17 November 12
  76. CONTRIBUTE TO OPEN SOURCE PROJECTS 26 Saturday, 17 November 12

  77. CONTRIBUTE TO OPEN SOURCE PROJECTS 27 Saturday, 17 November 12

  78. 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 27 Saturday, 17 November 12
  79. OPEN SOURCE YOUR OWN WORK 28 Saturday, 17 November 12

  80. OPEN SOURCE YOUR OWN WORK • Made something useful? Release

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

    it! 写了有⽤用的好玩意⼉儿?发布吧,勇敢的少年! • Be critisied of your work, and learn from mistakes. 虚⼼心接受意⻅见与批评,由错误中学习。 28 Saturday, 17 November 12
  82. 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. 为⾃自⼰己的⾟辛苦成果感到⾃自豪。 28 Saturday, 17 November 12
  83. 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. ⼀一点⼩小⼩小的贡献的话,可以哟〜~ 28 Saturday, 17 November 12
  84. OPEN SOURCE YOUR OWN WORK 28 Saturday, 17 November 12

  85. OPEN SOURCE YOUR OWN WORK 29 Saturday, 17 November 12

  86. 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. 29 Saturday, 17 November 12
  87. 30 Saturday, 17 November 12

  88. Credit: travis-ci.com 30 Saturday, 17 November 12

  89. SLIM A Case Study 31 Saturday, 17 November 12

  90. 32 Saturday, 17 November 12

  91. 33 Saturday, 17 November 12

  92. 33 Saturday, 17 November 12

  93. 33 Saturday, 17 November 12

  94. 34 Saturday, 17 November 12

  95. 35 Saturday, 17 November 12

  96. 36 Saturday, 17 November 12

  97. 37 Saturday, 17 November 12

  98. 38 Saturday, 17 November 12

  99. 39 Saturday, 17 November 12

  100. 40 Saturday, 17 November 12

  101. 41 Saturday, 17 November 12

  102. 42 Saturday, 17 November 12

  103. 43 Saturday, 17 November 12

  104. 44 Saturday, 17 November 12

  105. 45 Saturday, 17 November 12

  106. 46 Saturday, 17 November 12

  107. 47 Saturday, 17 November 12

  108. 48 Saturday, 17 November 12

  109. DO FREELANCE WORK 49 Saturday, 17 November 12

  110. DO FREELANCE WORK • Like open source work, but with

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

    deadlines and pressure. 截⽌止期限与压⼒力。 • Like open source work, but with some $$$. 赚点外快。 49 Saturday, 17 November 12
  112. 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. 不同的项⺫⽬目体验与经验。 49 Saturday, 17 November 12
  113. 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. 客户沟通经验。 49 Saturday, 17 November 12
  114. 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. 远程团队沟通经验。 49 Saturday, 17 November 12
  115. DO FREELANCE WORK 49 Saturday, 17 November 12

  116. AND LASTLY, YOUR DAY JOB 50 Saturday, 17 November 12

  117. AND LASTLY, YOUR DAY JOB • You spend most of

    your hours awake at your day job, make it count! 50 Saturday, 17 November 12
  118. 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. 知道⾃自⼰己想要什么。 50 Saturday, 17 November 12
  119. 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? 在这家公司⼯工作,能学习到什么? 50 Saturday, 17 November 12
  120. 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? 在这家公司⼯工作,学习到了什么? 50 Saturday, 17 November 12
  121. AND LASTLY, YOUR DAY JOB 50 Saturday, 17 November 12

  122. PERSONAL BRANDING 51 Saturday, 17 November 12

  123. PERSONAL BRANDING • Designers have online portfolios, what about us

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

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

    developers? • Blog - show me your thoughts! • Twitter/Weibo - show me your passion! 51 Saturday, 17 November 12
  126. 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! 51 Saturday, 17 November 12
  127. 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! 51 Saturday, 17 November 12
  128. PERSONAL BRANDING 52 Saturday, 17 November 12

  129. PERSONAL BRANDING • Build up your network 拓展交际圈 • Establish

    your reputation 树⽴立好名声 • People will endorse your work 让更多⼈人赞誉你的成果 52 Saturday, 17 November 12
  130. 53 Saturday, 17 November 12

  131. We can talk the talk 53 Saturday, 17 November 12

  132. LET’S WALK THE WALK We can talk the talk 53

    Saturday, 17 November 12
  133. 54 Saturday, 17 November 12

  134. How about a fun little task... 54 Saturday, 17 November

    12
  135. A SMALL CODE TEST How about a fun little task...

    54 Saturday, 17 November 12
  136. 55 Saturday, 17 November 12

  137. 55 Saturday, 17 November 12

  138. 55 Saturday, 17 November 12

  139. 55 Saturday, 17 November 12

  140. A BAD SOLUTION 56 Saturday, 17 November 12

  141. A BAD SOLUTION 57 Saturday, 17 November 12

  142. ANOTHER BAD SOLUTION 58 Saturday, 17 November 12

  143. ANOTHER BAD SOLUTION 59 Saturday, 17 November 12

  144. A GOOD SOLUTION 60 Saturday, 17 November 12

  145. A GOOD SOLUTION 61 Saturday, 17 November 12

  146. ANOTHER GOOD SOLUTION 62 Saturday, 17 November 12

  147. ANOTHER GOOD SOLUTION 63 Saturday, 17 November 12

  148. 64 Saturday, 17 November 12

  149. And behold, for a solution that... 64 Saturday, 17 November

    12
  150. BLOWS YOUR MIND ޵䙽੧໨ʂ And behold, for a solution that...

    64 Saturday, 17 November 12
  151. A 坑爹 SOLUTION 65 Saturday, 17 November 12

  152. A 坑爹 SOLUTION 66 Saturday, 17 November 12

  153. A 坑爹 SOLUTION 66 Saturday, 17 November 12

  154. A 坑爹 SOLUTION 67 Saturday, 17 November 12

  155. A 坑爹 SOLUTION 你妹啊! 67 Saturday, 17 November 12

  156. 68 Saturday, 17 November 12

  157. Writing features is (usually) not enough... 68 Saturday, 17 November

    12
  158. WE NEED TESTS! Writing features is (usually) not enough... 68

    Saturday, 17 November 12
  159. 69 Saturday, 17 November 12

  160. “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 69 Saturday, 17 November 12
  161. EFFECTIVE TESTS 70 Saturday, 17 November 12

  162. EFFECTIVE TESTS 70 Saturday, 17 November 12

  163. EFFECTIVE TESTS • They are describing ActiveRecord behaviours. 70 Saturday,

    17 November 12
  164. EFFECTIVE TESTS • They are describing ActiveRecord behaviours. • Allow

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

    mass assignments on foreign keys is wrong. • They are testing how methods are implemented. 70 Saturday, 17 November 12
  166. 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. 70 Saturday, 17 November 12
  167. DE-DUPLICATE TEST CASES 71 Saturday, 17 November 12

  168. DE-DUPLICATE TEST CASES 72 Saturday, 17 November 12

  169. DE-DUPLICATE TEST CASES 72 Saturday, 17 November 12

  170. DE-DUPLICATE TEST CASES 72 Saturday, 17 November 12

  171. DE-DUPLICATE TEST CASES 72 Saturday, 17 November 12

  172. REFACTOR IN THE WILD Improve code readability and maintainability 73

    Saturday, 17 November 12
  173. KEEP CONTROLLERS CLEAN 74 Saturday, 17 November 12

  174. 75 Saturday, 17 November 12

  175. 75 Saturday, 17 November 12

  176. 75 Saturday, 17 November 12

  177. 75 Saturday, 17 November 12

  178. 75 Saturday, 17 November 12

  179. 76 Saturday, 17 November 12

  180. A MORE COMPLETE EXAMPLE 77 Saturday, 17 November 12

  181. PROBLEM 78 Saturday, 17 November 12

  182. PROBLEM • A user has many trips 78 Saturday, 17

    November 12
  183. PROBLEM • A user has many trips • Each trip

    may contain more than one stops, e.g. • Beijing -> Shanghai • Shanghai -> Hongkong 78 Saturday, 17 November 12
  184. 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 78 Saturday, 17 November 12
  185. 79 Saturday, 17 November 12

  186. 79 Saturday, 17 November 12

  187. 79 Saturday, 17 November 12

  188. 79 Saturday, 17 November 12

  189. 79 Saturday, 17 November 12

  190. 79 Saturday, 17 November 12

  191. 79 Saturday, 17 November 12

  192. 79 Saturday, 17 November 12

  193. 79 Saturday, 17 November 12

  194. 80 Saturday, 17 November 12

  195. 80 Saturday, 17 November 12

  196. 81 Saturday, 17 November 12

  197. 81 Saturday, 17 November 12

  198. A RUBY-CHINA EXAMPLE Albeit an old example, but nonetheless... 82

    Saturday, 17 November 12
  199. 83 Saturday, 17 November 12

  200. 83 Saturday, 17 November 12

  201. 83 Saturday, 17 November 12

  202. 83 Saturday, 17 November 12

  203. 83 Saturday, 17 November 12

  204. 84 Saturday, 17 November 12

  205. 85 Saturday, 17 November 12

  206. REFACTOR + OPEN SOURCE 86 Saturday, 17 November 12

  207. IDENTIFY THE ISSUE 87 Saturday, 17 November 12

  208. IDENTIFY THE ISSUE 87 Saturday, 17 November 12

  209. ATTEMPT TO REFACTOR 88 Saturday, 17 November 12

  210. ATTEMPT TO REFACTOR 88 Saturday, 17 November 12

  211. ENCOUNTER UNEXPECTED PROBLEM 89 Saturday, 17 November 12

  212. ENSURE CODE INTEGRITY 90 Saturday, 17 November 12

  213. VERIFY THE ISSUE ELSEWHERE 91 Saturday, 17 November 12

  214. BEGIN DEBUGGING... 92 Saturday, 17 November 12

  215. TRACK DOWN THE CAUSE 93 Saturday, 17 November 12

  216. TRACK DOWN THE CAUSE 93 Saturday, 17 November 12

  217. FIX IT! 94 Saturday, 17 November 12

  218. FIX IT! 94 Saturday, 17 November 12

  219. ENSURE IT ACTUALLY WORKS 95 Saturday, 17 November 12

  220. ENSURE IT ACTUALLY WORKS 95 Saturday, 17 November 12

  221. ENSURE IT DIDN’T BREAK ANYTHING 96 Saturday, 17 November 12

  222. PULL REQUEST 97 Saturday, 17 November 12

  223. EMBRACE RUBY We are a fortunate bunch. 98 Saturday, 17

    November 12
  224. 99 Saturday, 17 November 12

  225. This portion of the slide is intentionally left blank. One

    function?! 100 Saturday, 17 November 12
  226. THANK YOU! :-) 101 Saturday, 17 November 12