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

Two programmers in one

Two programmers in one

My RubyNation 2014 talk

Ee64bbdcdeffabc6d4166a96e6d2a0d5?s=128

Jano González

June 07, 2014
Tweet

Transcript

  1. TWO PROGRAMMERS IN ONE

  2. @janogonzalez

  3. None
  4. A TALE OF TWO DEVELOPERS

  5. HACKER V/S  THINKER

  6. HACKER

  7. GET THINGS DONE

  8. FAST

  9. HACKS

  10. MAINTENANCE NIGHTMARE

  11. NEEDS MORE DUCT TAPE

  12. THINKER

  13. THINKS ABOUT ABSTRACTIONS

  14. THINKS ABOUT MAINTAINABILITY

  15. TOO MANY ABSTRACTIONS

  16. ANALYSIS PARALYSIS

  17. NEEDS MORE LAYERS

  18. MY HISTORY

  19. A TRILOGY OF MOVIES

  20. THE HACKER YEARS

  21. THE HACKER YEARS

  22. THE LEARNING YEARS

  23. THE UML YEARS

  24. THE UML YEARS

  25. THE HACKER WAS GONE

  26. UML, RUP, GoF, XML, ETC.

  27. STOCKHOLM SYNDROME

  28. EVOLUTION?

  29. THE ONE TRUE WAY™

  30. THE PATH?

  31. FEAR

  32. I WAS SO WRONG!

  33. EVERYDAY LIFE  IS THE PATH

  34. ENTER RUBY

  35. SMALLTALK IN PERL’S DISGUISE

  36. HAPPY THINKER

  37. THINKER class AccountProtectionProxy def initialize(real_account, owner) @subject = real_account @owner

    = owner end ! def method_missing(name, *args) check_access @subject.send(name, *args) end ...
  38. OMG! GoF NEVER WAS SO EASY

  39. HAPPY HACKER

  40. HACKER $1 if str ~= /(foo)+/

  41. ONE LINERS FTW!

  42. HACKER ❤ THINKER

  43. LET’S WORK TOGETHER

  44. HARMONY

  45. HARMONY (1..42).select(&:even?). map { |n| n * 2 }. reduce(&:*)

  46. THE PATH

  47. THE PATH IS NO PATH

  48. THE PATH

  49. WORKING TOGETHER

  50. HACKER

  51. EXPLORE NEW TERRITORY

  52. THINKER

  53. FIND ACCEPTANCE CRITERIA

  54. DEFINE COMPONENTS

  55. BALANCE

  56. DELIVER VALUE V/S DIMINISH TECHNICAL DEBT

  57. CREATIVITY V/S STANDARDIZATION

  58. EXAMPLE

  59. CASE STATEMENT V/S FACTORY + COMMANDS

  60. CASE STATEMENT

  61. EXAMPLE case account_type when :premium then # do stuff when

    :standard then # do stuff when :personal then # do stuff end
  62. FACTORY + COMMANDS

  63. EXAMPLE class PremiumAccount def initialize # do stuff end !

    def execute(context) # do stuff end end
  64. EXAMPLE class AccountFactory def self.create(type) name = "#{type.capitalize}Account" klass =

    Kernel.const_get(name) klass.new end end
  65. EXAMPLE AccountFactory .create(account_type) .execute(context)

  66. THE BEST APPROACH?

  67. IMPLICIT V/S EXPLICIT

  68. CLARITY V/S DRY

  69. CLARITY V/S SRP

  70. NOW V/S FUTURE

  71. MY HUMBLE ADVICE

  72. LEARN ABOUT BEST PRACTICES

  73. DON’T FOLLOW BLINDLY YOUR FUNCTIONAL GURU

  74. DON’T FOLLOW BLINDLY YOUR OO GURU

  75. TESTS + REFACTORING

  76. HOW TO IMPROVE IF YOU ARE A…

  77. HACKER

  78. LEARN ABOUT OOP & PATTERNS

  79. TRY IMMUTABILITY & SEQUENCES

  80. DO SEPARATE RESPONSIBILITIES

  81. THINKER

  82. LEARN ABOUT ONE LINERS

  83. TRY CODE GOLF

  84. DO EVIL STUFF

  85. EVERYONE

  86. READ A LOT OF CODE

  87. WRITE A LOT OF CODE

  88. ONE LAST ADVICE

  89. 守破離

  90. SHU 守破離

  91. HA 守破離

  92. RI 守破離

  93. None
  94. ANTIPATTERN: ETERNAL SHU

  95. ANTIPATTERN: START IN HA

  96. CONCLUSIONS

  97. RUBY GIVES YOU FREEDOM

  98. LETS YOU STRIVE FOR BALANCE

  99. AVOID CARGO CULT

  100. GOOD ADVICE V/S LAWS

  101. THERE IS NO TRUE PATH

  102. IF YOU MEET THE BUDDHA IN THE ROAD, KILL HIM!

  103. FOLLOW YOUR ❤

  104. THANK YOU! ❤

  105. IMAGES ! • http://commons.wikimedia.org/wiki/File:Yin_yang.svg • http://upload.wikimedia.org/wikipedia/commons/archive/f/ f4/20050917122925%21Janus-Vatican.JPG