Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Code Reading
Search
高見龍
May 31, 2013
Programming
6
1.3k
Code Reading
Learning More about Ruby by Reading Ruby Source Code'
高見龍
May 31, 2013
Tweet
Share
More Decks by 高見龍
See All by 高見龍
前端模組解放運動 - importmap
eddie
0
900
Git 和 DevOps - 在混亂的流星群開發流程中找到小確幸
eddie
1
1k
模組化前端開發:從亂七八糟到組織有序
eddie
0
1.2k
被 Vue 框架耽誤的建置工具
eddie
1
860
開開心心寫測試,你的程式碼也會微笑
eddie
1
1.1k
Functional Ruby
eddie
0
220
閱讀原始碼 - 再戰十年的 jQuery
eddie
1
700
Learn JavaScript Well
eddie
1
1.2k
How to Learn Web Framework Correctly
eddie
4
1.9k
Other Decks in Programming
See All in Programming
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
130
Fragment Composition of GraphQL
quramy
7
980
Compose-View Interop in Practice (mDevCamp 2024)
stewemetal
0
130
Git Rebase
bkuhlmann
11
1.6k
使ってみよう Azure AI Document Intelligence
kosmosebi
2
310
冗長なエラーログを削減し、スタックトレースを手に入れる / Reducing Verbose Error Logs and Obtaining Stack Traces
upamune
0
680
GitHub Actionsで泣かないためにやっておきたい設定 / Recommended GHA settings to avoid crying
pinkumohikan
3
530
Scalable Customer Journey Orchestration (CJO)
lewuathe
0
310
Tailwind CSSを本気でカスタマイズする方法
fsubal
13
5.3k
『Railsオワコン』と言われる時代に、なぜブルーモ証券はRailsを選ぶのか
free_world21
0
220
二郎系ラーメンのコールで学ぶ AST 解析
memory1994
PRO
7
1.7k
PostmanでAPIの動作確認が楽になった話
h455h1
0
170
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
121
39k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
2
1.3k
Build your cross-platform service in a week with App Engine
jlugia
225
17k
YesSQL, Process and Tooling at Scale
rocio
164
13k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
241
1.2M
Fashionably flexible responsive web design (full day workshop)
malarkey
398
65k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
40
4.4k
How GitHub Uses GitHub to Build GitHub
holman
468
290k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
Facilitating Awesome Meetings
lara
42
5.6k
The Brand Is Dead. Long Live the Brand.
mthomps
49
29k
The Illustrated Children's Guide to Kubernetes
chrisshort
31
46k
Transcript
None
高見 龍 です
高 見龍 です @eddiekao
Code Reading Chimpr Learning more about Ruby by Reading Ruby
Source Code
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
None
None
I’m a Python guy (≈ 2 years) I’m a iOS
app guy (≈ 2 years) I’m a Flash guy (≈ 8 years) I’m a Ruby guy (≈ 4 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!
None
Web Development Conference in Taiwan
None
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
http://blog.rubybestpractices.com/posts/gregory/005-code-reading-stdlib.html “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
See how the Core Team write Ruby
photo by chaines106 Read the source, Luke!
source http://kyaraben.seesaa.net/article/168967765.html source code は友達
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
None
Quick browsing.. :)
* .c + * .h * .rb (stdlib)
Let’s have some fun!
Object Class String Array Hash
“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", "
[email protected]
"], "Joanne" => ["yellow",
"
[email protected]
"] } people.map { |name, (color, email)| puts [name, email] }
parse.y#8277-8299 shadowing_lvar_gen( ) people = { "Eddie" => ["green", "
[email protected]
"],
"Joanne" => ["yellow", "
[email protected]
"] } people.map { |name, (_, email)| puts [name, email] }
Method missing
Anything interesting ?
Interesting naming.. XD
Conclusion
“from basic structure”
“don’t be afraid of source code”
source http://kyaraben.seesaa.net/article/168967765.html source code は友達
References
http://i.loveruby.net/ja/rhg/book/ “Rubyソースコード完全解説” (RHG) by 青木峰郎
http://patshaughnessy.net/ruby-under-a-microscope “Ruby Under a Microscope” by Pat Shaughnessy
Chimpr Hope we all can become Jedi Master someday :)
高見 龍 です
以上です。 ご清聴ありがとうございました thanks for your listening :)
高見龍 Contacts photo by Eddie Website Blog Plurk Facebook Google
Plus Twitter Email Mobile http://www.eddie.com.tw http://blog.eddie.com.tw http://www.plurk.com/aquarianboy http://www.facebook.com/eddiekao http://www.eddie.com.tw/+ https://twitter.com/#!/eddiekao
[email protected]
+886-928-617-687