Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Code Reading

514 views

Published on

Learning More about Ruby by Reading Ruby Source Code

Published in: Technology
  • Be the first to comment

Code Reading

  1. 1. 高見 龍 です
  2. 2. 高 見龍 です @eddiekao
  3. 3. Code Reading Learning more about Ruby by Reading Ruby Source Code Chimpr
  4. 4. I come from Taiwan photo by Fishtail@Taipei
  5. 5. photo by J o n a G r a p h Y 
  6. 6. photo by HeyNix
  7. 7. photo by randomwire
  8. 8. I’m a Flash guy (≈ 8 years) I’m a Python guy (≈ 2 years) I’m a Ruby guy (≈ 4 years) I’m a iOS app guy (≈ 2 years)
  9. 9. But not a C guy, yet!
  10. 10. Ruby > Rails
  11. 11. “I’m a SHOW OFF person”
  12. 12. “Experience Sharing is fun”
  13. 13. Current Status 80% iOS app, 20% Ruby/Rails
  14. 14. 100% Ruby Lover!
  15. 15. Web Development Conference in Taiwan
  16. 16. 2 days, 3 tracks session
  17. 17. 750+ attendees
  18. 18. all tickets sold out in 4 mins
  19. 19. WebConf Taiwan 2014
  20. 20. Will be held on Jan 2014
  21. 21. 850+ attendees in 2014, hopefully.
  22. 22. All about web development
  23. 23. 楽しい
  24. 24. http://webconf.tw
  25. 25. Code Reading
  26. 26. Why read source code? How to start? What I learned? Anything interesting?
  27. 27. Why read source code ?
  28. 28. Ian Ruotsala
  29. 29. “once you start digging around in someone else’s code base, you’ll learn a lot about your own strengths and weaknesses” - Ruby Best Practice http://blog.rubybestpractices.com/posts/gregory/005-code-reading-stdlib.html
  30. 30. See how the Core Team write Ruby
  31. 31. Read the source, Luke! photo by chaines106
  32. 32. source code は友達 source http://kyaraben.seesaa.net/article/168967765.html
  33. 33. Contribution!
  34. 34. Committer in my dream!
  35. 35. FUN! :)
  36. 36. Requirement ?
  37. 37. C language
  38. 38. “What if I don’t have any skill of C?”
  39. 39. “Just Learn It!”
  40. 40. Curiosity and Passion
  41. 41. Where to Start ?
  42. 42. get source files!
  43. 43. download from Ruby website, or clone from github
  44. 44. Ruby 1.9.2 p290
  45. 45. Quick browsing.. :)
  46. 46. *c + *h . . *rb (stdlib) .
  47. 47. Let’s have some fun!
  48. 48. Object Class String Hash Array
  49. 49. “ruby.h”
  50. 50. Object => RObject Class => RClass String => RString Array => RArray Hash => RHash
  51. 51. “object.c”
  52. 52. Init_XXXX( )
  53. 53. “all Class’s class is a Class”
  54. 54. “new”
  55. 55. class A def initialize puts "hello" end end a = A.new
  56. 56. Proc
  57. 57. How to execute a Proc?
  58. 58. proc.call proc[ ] proc.yield proc === 123
  59. 59. attributes
  60. 60. push v.s. <<
  61. 61. Object ID
  62. 62. What else?
  63. 63. Haskell-like syntax :)
  64. 64. head (x:_)        = x tail (_:xs)        = xs
  65. 65. people = { "Eddie" => ["green", "eddie@digik.com.tw"], "Joanne" => ["yellow", "hello@yahoo.com"] } people.map { |name, (color, email)| puts [name, email] }
  66. 66. people = { "Eddie" => ["green", "eddie@digik.com.tw"], "Joanne" => ["yellow", "hello@yahoo.com"] } people.map { |name, (_, email)| puts [name, email] } parse.y#8277-8299 shadowing_lvar_gen( )
  67. 67. Method missing
  68. 68. Anything interesting ?
  69. 69. Interesting naming.. XD
  70. 70. Conclusion
  71. 71. “from basic structure”
  72. 72. “don’t be afraid of source code”
  73. 73. source code は友達 source http://kyaraben.seesaa.net/article/168967765.html
  74. 74. References
  75. 75. “Rubyソースコード完全解説” (RHG) by 青木峰郎 http://i.loveruby.net/ja/rhg/book/
  76. 76. “Ruby Under a Microscope” by Pat Shaughnessy http://patshaughnessy.net/ruby-under-a-microscope
  77. 77. Hope we all can become Jedi Master someday :) Chimpr
  78. 78. 高見 龍 です
  79. 79. 以上です。 ご清聴ありがとうございました thanks for your listening :)
  80. 80. Contacts 高見龍 Website http://www.eddie.com.tw Blog http://blog.eddie.com.tw Plurk http://www.plurk.com/aquarianboy Facebook http://www.facebook.com/eddiekao Google Plus http://www.eddie.com.tw/+ Twitter https://twitter.com/#!/eddiekao Email eddie@digik.com.tw Mobile +886-928-617-687 photo by Eddie

×