The Road to Ruby Mastery (RailsClub Moscow 2017)

The Road to Ruby Mastery (RailsClub Moscow 2017)

Slide-deck from my presentation at RailsClub Moscow 2017.

1be785d1d788b82929e55fc83a9f0aaa?s=128

Bozhidar Batsov

September 23, 2017
Tweet

Transcript

  1. None
  2. Божидар

  3. I’m back

  4. None
  5. None
  6. None
  7. None
  8. None
  9. None
  10. None
  11. None
  12. None
  13. None
  14. None
  15. None
  16. None
  17. None
  18. None
  19. None
  20. None
  21. Большое спасибо!

  22. Большое спасибо!

  23. Sofia, Bulgaria

  24. Sofia, Bulgaria

  25. None
  26. I’m an Emacs fanatic

  27. bbatsov

  28. None
  29. None
  30. They call me Master…

  31. … and I’m a Rubyist

  32. I must be The Master Rubyist!

  33. None
  34. This guy is so deep and profound!

  35. The Road to Ruby Mastery by Bozhidar Batsov

  36. Master

  37. having or showing very great skill or proficiency

  38. None
  39. Novice

  40. a person new to and inexperienced in a job or

    situation
  41. None
  42. Journeyman

  43. a worker, performer, or athlete who is experienced and good

    but not excellent
  44. None
  45. Dreyfus Model of Skill Acquisition

  46. Novice Advanced Beginner Competent Proficient Expert

  47. The Road to Mastery

  48. None
  49. not really

  50. try 10 years

  51. http://norvig.com/21- days.html Teach Yourself Programming in Ten Years Peter Norvig

  52. Apprenticeship

  53. Novice Journeyman Master Apprenticeship Apprenticeship

  54. learning from others

  55. directly

  56. indirectly

  57. Computer Science Fundamentals

  58. None
  59. None
  60. None
  61. None
  62. None
  63. None
  64. None
  65. None
  66. None
  67. None
  68. None
  69. Object-oriented programming

  70. None
  71. Ruby is a purely object- oriented language

  72. None
  73. None
  74. Know Thy Language!

  75. Crazy People

  76. None
  77. Ruby is a VERY COMPLEX language!

  78. class instance variable

  79. protected

  80. module_function vs extend self

  81. refinements

  82. super vs super()

  83. == === equal? eql?

  84. None
  85. None
  86. Grokking the language

  87. Understanding and appreciating its philosophy

  88. Coming to grips with reality

  89. (no language is perfect)

  90. (not even Clojure)

  91. (some languages really suck)

  92. Master the idioms

  93. for i in 1..3 puts "Hello, Moscow!” end

  94. 3.times do puts "Hello, Moscow!” end

  95. if some_condition then # body omitted end

  96. def some_method # ... return result end

  97. None
  98. None
  99. None
  100. Read some (good) code

  101. some == A LOT

  102. None
  103. Obtain a notion of style

  104. None
  105. None
  106. Ruby Style Guide

  107. None
  108. Tackle problems with style

  109. None
  110. puts debugging sucks

  111. bla bla bla puts ‘********’ puts x puts ‘********’

  112. None
  113. pro “puts” debugging techniques

  114. object = Object.new puts object.method(:blank?).source_location # => ["/gems/activesupport-5.0.0.beta1/ lib/active_support/core_ext/object/ blank.rb",

    14]
  115. class Bar def foo puts "=====================" puts caller end end

  116. def foo puts method(:foo).super_method.source_location super end

  117. def parse(input, skip_code_comments: false, ignore_whitespace: true) # do stuff end

    method(:parse).parameters #=> [[:req, :input], [:key, :skip_code_comments], [:key, :ignore_whitespace]]
  118. config.thing = { "foo" => "bar" } config.thing.freeze = {

    "foo" => "bar" } config.thing.delete("foo") # active_support/concurrency/share_lock.rb:151:in `delete': can't modify frozen Hash (RuntimeError) # from active_support/concurrency/share_lock.rb:151:in `yield_shares' # from active_support/concurrency/share_lock.rb:79:in `block in stop_exclusive'
  119. Ruby Debugging Magic Cheat Sheet http://www.schneems.com/2016/01/25/ruby-debugging-magic-cheat- sheet.html

  120. I am a puts debugger https://tenderlovemaking.com/2016/02/05/i-am-a-puts-debuggerer.html

  121. I am not a puts debugger!

  122. byebug https://github.com/deivid-rodriguez/byebug

  123. pry-byebug https://github.com/deivid-rodriguez/pry-byebug

  124. Profiling stuff

  125. ruby-prof https://github.com/ruby-prof/ruby-prof

  126. memory_profiler https://github.com/SamSaffron/memory_profiler

  127. None
  128. Beyond Rails

  129. Opal

  130. RubyMotion

  131. System administration

  132. JRuby

  133. Alternative web frameworks

  134. Hanami

  135. Padrino

  136. Sinatra

  137. Roda

  138. Keep in sync

  139. RubyWeekly

  140. Ruby5

  141. RubyRogues

  142. RubyTapas

  143. GoRails

  144. RailsClub

  145. RubyConf

  146. RailsConf

  147. Always be exploring!

  148. Clojure

  149. Haskell

  150. Elm

  151. Erlang/Elixir

  152. Racket

  153. Ideas from other programming languages make us better programmers

  154. One more thing…

  155. Ruby is simply not a good fit for every possible

    problem
  156. None
  157. None
  158. ФЕЛИНА

  159. Епилог twitter: @bbatsov github: @bbatsov http//batsov.com http://emacsredux.com RailsClub Moscow, Russia

    23.09.2017