高見 龍 です
高 見龍 です
@eddiekao
Code Reading
Learning more about Ruby by Reading Ruby Source Code
Chimpr
I come from Taiwan

photo by Fishtail@Taipei
photo by J o n a G r a p h Y 
photo by HeyNix
photo by randomwire
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)
But not a C guy, yet!
Ruby > Rails
“I’m a SHOW OFF person”
“Experience Sharing is fun”
Current Status
80% iOS app, 20% Ruby/Rails
100% Ruby Lover!
Web Development Conference in Taiwan
2 days, 3 tracks session
750+ attendees
all tickets sold out in 4 mins
WebConf Taiwan 2014
Will be held on Jan 2014
850+ attendees in 2014, hopefully.
All about web development
楽しい
http://webconf.tw
Code Reading
Why read source code?
How to start?
What I learned?
Anything interesting?
Why read source code ?
Ian Ruotsala
“once you start digging around in someone
else’s code base, you’ll learn a lot about
your own strengths and weaknesses”
- ...
See how the Core Team write Ruby
Read the source, Luke!
photo by chaines106
source code は友達
source http://kyaraben.seesaa.net/article/168967765.html
Contribution!
Committer
in my dream!
FUN! :)
Requirement ?
C language
“What if I don’t have any skill of C?”
“Just Learn It!”
Curiosity and Passion
Where to Start ?
get source files!
download from Ruby website,
or clone from github
Ruby 1.9.2 p290
Quick browsing.. :)
*c + *h
. .
*rb (stdlib)
.
Let’s have some fun!
Object
Class
String
Hash

Array
“ruby.h”
Object => RObject
Class => RClass
String => RString
Array => RArray
Hash => RHash
“object.c”
Init_XXXX( )
“all Class’s class is a Class”
“new”
class A
def initialize
puts "hello"
end
end
a = A.new
Proc
How to execute a Proc?
proc.call
proc[ ]
proc.yield
proc === 123
attributes
push v.s. <<
Object ID
What else?
Haskell-like syntax :)
head (x:_)        = x
tail (_:xs)        = xs
people = {
"Eddie" => ["green", "eddie@digik.com.tw"],
"Joanne" => ["yellow", "hello@yahoo.com"]
}
people.map { |name, (co...
people = {
"Eddie" => ["green", "eddie@digik.com.tw"],
"Joanne" => ["yellow", "hello@yahoo.com"]
}
people.map { |name, (_,...
Method missing
Anything interesting ?
Interesting naming.. XD
Conclusion
“from basic structure”
“don’t be afraid of source code”
source code は友達
source http://kyaraben.seesaa.net/article/168967765.html
References
“Rubyソースコード完全解説” (RHG)
by 青木峰郎
http://i.loveruby.net/ja/rhg/book/
“Ruby Under a Microscope”
by Pat Shaughnessy
http://patshaughnessy.net/ruby-under-a-microscope
Hope we all can become
Jedi Master someday :)
Chimpr
高見 龍 です
以上です。
ご清聴ありがとうございました

thanks for your listening :)
Contacts
高見龍

Website

http://www.eddie.com.tw

Blog

http://blog.eddie.com.tw

Plurk

http://www.plurk.com/aquarianboy

F...
Code Reading
Code Reading
Code Reading
Code Reading
Code Reading
Code Reading
Upcoming SlideShare
Loading in …5
×

Code Reading

412 views
282 views

Published on

Learning More about Ruby by Reading Ruby Source Code

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
412
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
3
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

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

×