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.5k
Code Reading
Learning More about Ruby by Reading Ruby Source Code'
高見龍
May 31, 2013
Tweet
Share
More Decks by 高見龍
See All by 高見龍
宅宅自以為的浪漫:跟 AI 一起為自己辦的研討會寫一個售票系統
eddie
0
540
自己的售票系統自己做!
eddie
0
540
AI Agent 時代的開發者生存指南
eddie
4
2.6k
print("Hello, World")
eddie
2
620
為你自己學 Python - 冷知識篇
eddie
1
430
為你自己學 Python
eddie
0
720
Generative AI 年會小聚 - AI 教我寫程式
eddie
0
190
讓數據說話:用 Python、Prometheus 和 Grafana 講故事
eddie
0
710
AI 時代的程式語言學習法
eddie
0
230
Other Decks in Programming
See All in Programming
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
160
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
590
CSC307 Lecture 01
javiergs
PRO
0
680
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6k
今から始めるClaude Code超入門
448jp
7
8.3k
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
140
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
160
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
5.9k
CSC307 Lecture 08
javiergs
PRO
0
660
Vibe codingでおすすめの言語と開発手法
uyuki234
0
220
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
140
CSC307 Lecture 02
javiergs
PRO
1
770
Featured
See All Featured
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
580
Test your architecture with Archunit
thirion
1
2.1k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2k
How to build a perfect <img>
jonoalderson
1
4.9k
Six Lessons from altMBA
skipperchong
29
4.1k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
72
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
210
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
60
42k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
Darren the Foodie - Storyboard
khoart
PRO
2
2.3k
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