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
1.5k
6
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Code Reading
Learning More about Ruby by Reading Ruby Source Code'
高見龍
May 31, 2013
More Decks by 高見龍
See All by 高見龍
宅宅自以為的浪漫:跟 AI 一起為自己辦的研討會寫一個售票系統
eddie
0
630
自己的售票系統自己做!
eddie
0
640
AI Agent 時代的開發者生存指南
eddie
4
2.8k
print("Hello, World")
eddie
2
670
為你自己學 Python - 冷知識篇
eddie
1
480
為你自己學 Python
eddie
0
780
Generative AI 年會小聚 - AI 教我寫程式
eddie
0
240
讓數據說話:用 Python、Prometheus 和 Grafana 講故事
eddie
0
780
AI 時代的程式語言學習法
eddie
0
290
Other Decks in Programming
See All in Programming
自動化したのに回らないテスト運用の壁ーAI時代の品質責任と生産性
mfunaki
0
120
Foundation Models frameworkで画像分析
ryodeveloper
1
510
Prismを使った型安全な暗号化_関数型まつり2026
_fhhmm
0
170
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
290
人間の目はかわらない、だからJPEGは30年もつ
yuzneri
12
18k
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
390
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
1
640
ITヒヤリハットを整理してみた ~ライフサイクルと原因から考える再発防止策~
koukimiura
1
140
Lean は証明の正しさを確認するためだけのツールって思ってませんか?
inoueasei
1
140
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
550
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
200
全PRの83%がAIレビューだけでマージできるようになった開発組織はその後どうなったか
athug
1
1.4k
Featured
See All Featured
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
190
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
560
Thoughts on Productivity
jonyablonski
76
5.3k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
450
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.5k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
480
Amusing Abliteration
ianozsvald
1
240
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