20101204 you-must-unlearn-what-you-have-learned

104
Rubyの教えてくれたこと 島田 浩二 [email protected] — You must unlearn what you have learned. 2010年12月4日(土) 札幌Ruby会議03 2010125日日曜日

description

 

Transcript of 20101204 you-must-unlearn-what-you-have-learned

Page 1: 20101204 you-must-unlearn-what-you-have-learned

Rubyの教えてくれたこと

島田 浩二[email protected]

— You must unlearn what you have learned.

2010年12月4日(土) 札幌Ruby会議03

2010年12月5日日曜日

Page 2: 20101204 you-must-unlearn-what-you-have-learned

今日お話しすること

2010年12月5日日曜日

Page 3: 20101204 you-must-unlearn-what-you-have-learned

“Joyful Ruby”2010年12月5日日曜日

Page 4: 20101204 you-must-unlearn-what-you-have-learned

Rubyにたいして僕が感じている“良さ”と、それと触れ合う中で学んだ大切ないくつかのことについて

2010年12月5日日曜日

Page 5: 20101204 you-must-unlearn-what-you-have-learned

自己紹介

2010年12月5日日曜日

Page 6: 20101204 you-must-unlearn-what-you-have-learned

しまだ こうじ島田 浩二

Photo by tmaeda

2010年12月5日日曜日

Page 7: 20101204 you-must-unlearn-what-you-have-learned

2010年12月5日日曜日

Page 8: 20101204 you-must-unlearn-what-you-have-learned

2010年12月5日日曜日

Page 9: 20101204 you-must-unlearn-what-you-have-learned

日本Rubyの会2010年12月5日日曜日

Page 10: 20101204 you-must-unlearn-what-you-have-learned

RubyKaigi

2010年12月5日日曜日

Page 11: 20101204 you-must-unlearn-what-you-have-learned

2010年12月5日日曜日

Page 12: 20101204 you-must-unlearn-what-you-have-learned

from Sapporo,with Love for Ruby

Photo by darashi

2010年12月5日日曜日

Page 13: 20101204 you-must-unlearn-what-you-have-learned

よろしくお願いします

2010年12月5日日曜日

Page 14: 20101204 you-must-unlearn-what-you-have-learned

Rubyの教えてくれたこと

島田 浩二[email protected]

— You must unlearn what you have learned.

2010年12月4日(土) 札幌Ruby会議03

2010年12月5日日曜日

Page 15: 20101204 you-must-unlearn-what-you-have-learned

私について

2010年12月5日日曜日

Page 16: 20101204 you-must-unlearn-what-you-have-learned

ふつうのプログラマ

2010年12月5日日曜日

Page 17: 20101204 you-must-unlearn-what-you-have-learned

一度も自分自身で満足のいくようなコードを書けたことがない平凡なプログラマである私が、Rubyと一緒にプログラミングしているときにたまに感じてしまう錯覚

2010年12月5日日曜日

Page 18: 20101204 you-must-unlearn-what-you-have-learned

オレってばスゲー感

2010年12月5日日曜日

Page 19: 20101204 you-must-unlearn-what-you-have-learned

“Rubyをキメると気持ち良い

 - まつもとゆきひろ RubyKaigi2008

2010年12月5日日曜日

Page 20: 20101204 you-must-unlearn-what-you-have-learned

QWAN on Ruby

2010年12月5日日曜日

Page 21: 20101204 you-must-unlearn-what-you-have-learned

ブロック

http://www.flickr.com/photos/33224129@N00/3301269103/

2010年12月5日日曜日

Page 22: 20101204 you-must-unlearn-what-you-have-learned

ブロック

2010年12月5日日曜日

Page 23: 20101204 you-must-unlearn-what-you-have-learned

ブロック

2010年12月5日日曜日

Page 24: 20101204 you-must-unlearn-what-you-have-learned

ブロック

2010年12月5日日曜日

Page 25: 20101204 you-must-unlearn-what-you-have-learned

ブロック

2010年12月5日日曜日

Page 26: 20101204 you-must-unlearn-what-you-have-learned

ブロックを使ってできること

2010年12月5日日曜日

Page 27: 20101204 you-must-unlearn-what-you-have-learned

イテレータ

2010年12月5日日曜日

Page 28: 20101204 you-must-unlearn-what-you-have-learned

繰り返し

2010年12月5日日曜日

Page 29: 20101204 you-must-unlearn-what-you-have-learned

具体的な処理の記述

2010年12月5日日曜日

Page 30: 20101204 you-must-unlearn-what-you-have-learned

対称性のある処理の保証

2010年12月5日日曜日

Page 31: 20101204 you-must-unlearn-what-you-have-learned

対称性のある処理の保証

2010年12月5日日曜日

Page 32: 20101204 you-must-unlearn-what-you-have-learned

アルゴリズムの差し替え

2010年12月5日日曜日

Page 33: 20101204 you-must-unlearn-what-you-have-learned

実現していること

状況によって変わる可能性のある部分をあとからコードを修正せずに

差し替えることができる

2010年12月5日日曜日

Page 34: 20101204 you-must-unlearn-what-you-have-learned

状況によって変わるもの

• 条件• アルゴリズム• 具体的な処理

2010年12月5日日曜日

Page 35: 20101204 you-must-unlearn-what-you-have-learned

ブロックでないとできない?

2010年12月5日日曜日

Page 36: 20101204 you-must-unlearn-what-you-have-learned

No

例えばデザインパターンにある構造を採用して

2010年12月5日日曜日

Page 37: 20101204 you-must-unlearn-what-you-have-learned

違い

2010年12月5日日曜日

Page 38: 20101204 you-must-unlearn-what-you-have-learned

実現の仕方

2010年12月5日日曜日

Page 39: 20101204 you-must-unlearn-what-you-have-learned

Strategyパターンを使って:

ブロックを使って:

アルゴリズムを実行時に切り替えたい

2010年12月5日日曜日

Page 40: 20101204 you-must-unlearn-what-you-have-learned

ブロックの良さ

2010年12月5日日曜日

Page 41: 20101204 you-must-unlearn-what-you-have-learned

構造を複雑にせずに程よい柔軟性を確保できる

ブロックの良さ

2010年12月5日日曜日

Page 42: 20101204 you-must-unlearn-what-you-have-learned

複雑性

2010年12月5日日曜日

Page 43: 20101204 you-must-unlearn-what-you-have-learned

二つの複雑性

2010年12月5日日曜日

Page 44: 20101204 you-must-unlearn-what-you-have-learned

問題にもともと存在している複雑性

2010年12月5日日曜日

Page 45: 20101204 you-must-unlearn-what-you-have-learned

動かすために入れてしまった複雑性

2010年12月5日日曜日

Page 46: 20101204 you-must-unlearn-what-you-have-learned

“ソフトウェアは複雑さの増大によってダメになる - Andrew Hunt and Dave omas,

e Pragmatic Programmer

2010年12月5日日曜日

Page 47: 20101204 you-must-unlearn-what-you-have-learned

YAGNI

You Ain ’t Gonna Need I tどうせ要らないって

2010年12月5日日曜日

Page 48: 20101204 you-must-unlearn-what-you-have-learned

どうしても必要があるという場合以外には複雑税は払わない

2010年12月5日日曜日

Page 49: 20101204 you-must-unlearn-what-you-have-learned

実現したいこと

2010年12月5日日曜日

Page 50: 20101204 you-must-unlearn-what-you-have-learned

状況によって変わる可能性のある部分をあとからコードを修正せずに

差し替えることができる

2010年12月5日日曜日

Page 51: 20101204 you-must-unlearn-what-you-have-learned

変化ヲ抱擁セヨ

2010年12月5日日曜日

Page 52: 20101204 you-must-unlearn-what-you-have-learned

2010年12月5日日曜日

Page 53: 20101204 you-must-unlearn-what-you-have-learned

SOLID PrincipleSRP Single ResponsibilityOCP Open-ClosedLSP Liscov Substitution

ISP Interface SegregationDIP Dependency Inversion

2010年12月5日日曜日

Page 55: 20101204 you-must-unlearn-what-you-have-learned

変化に適応する

変化を抱擁する

2010年12月5日日曜日

Page 56: 20101204 you-must-unlearn-what-you-have-learned

“Expect Unexpected Change

「予期しない変化が起きる」ということを予期して備える

2010年12月5日日曜日

Page 57: 20101204 you-must-unlearn-what-you-have-learned

どうやって

2010年12月5日日曜日

Page 58: 20101204 you-must-unlearn-what-you-have-learned

シンプルなコードと包括的なテストで

変化を抱擁する

2010年12月5日日曜日

Page 59: 20101204 you-must-unlearn-what-you-have-learned

シンプルなコード

2010年12月5日日曜日

Page 60: 20101204 you-must-unlearn-what-you-have-learned

包括的なテスト

2010年12月5日日曜日

Page 61: 20101204 you-must-unlearn-what-you-have-learned

/ / / f

GrowingObject-OrientedSoftware,Guided by TestsSteve FreemanNat Pryce

H M M — — i

Foreword by Kent BeckAfterword by Tim Mackinnon

2010年12月5日日曜日

Page 62: 20101204 you-must-unlearn-what-you-have-learned

本当に必要だとわかるまで可能な限り決定を遅らせる

変化を抱擁する

2010年12月5日日曜日

Page 63: 20101204 you-must-unlearn-what-you-have-learned

構造を複雑にせずに程よい柔軟性を確保できる

ブロックの良さ

2010年12月5日日曜日

Page 64: 20101204 you-must-unlearn-what-you-have-learned

本当に必要になるまで処理の決定を遅らせる

ブロックの良さ

2010年12月5日日曜日

Page 65: 20101204 you-must-unlearn-what-you-have-learned

/ / / f

GrowingObject-OrientedSoftware,Guided by TestsSteve FreemanNat Pryce

H M M — — i

Foreword by Kent BeckAfterword by Tim Mackinnon

2010年12月5日日曜日

Page 66: 20101204 you-must-unlearn-what-you-have-learned

http://www.flickr.com/photos/barnaby_s/2332109365/2010年12月5日日曜日

Page 67: 20101204 you-must-unlearn-what-you-have-learned

ブロックが僕に教えてくれたこと

2010年12月5日日曜日

Page 68: 20101204 you-must-unlearn-what-you-have-learned

道具を知ること

2010年12月5日日曜日

Page 69: 20101204 you-must-unlearn-what-you-have-learned

道具の影響

2010年12月5日日曜日

Page 70: 20101204 you-must-unlearn-what-you-have-learned

パワーと制約

2010年12月5日日曜日

Page 71: 20101204 you-must-unlearn-what-you-have-learned

道具を知り道具を選ぶ

2010年12月5日日曜日

Page 72: 20101204 you-must-unlearn-what-you-have-learned

Push Your Self to Learn

2010年12月5日日曜日

Page 73: 20101204 you-must-unlearn-what-you-have-learned

To do good work ♥ your tools

良い仕事のためにはツールに♥を

23

2010年12月5日日曜日

Page 74: 20101204 you-must-unlearn-what-you-have-learned

道具を知ること

2010年12月5日日曜日

Page 75: 20101204 you-must-unlearn-what-you-have-learned

もう一つ

ブロックの良さ

2010年12月5日日曜日

Page 76: 20101204 you-must-unlearn-what-you-have-learned

http://www.flickr.com/photos/aslakr/14507479/2010年12月5日日曜日

Page 77: 20101204 you-must-unlearn-what-you-have-learned

ActiveRecord

2010年12月5日日曜日

Page 78: 20101204 you-must-unlearn-what-you-have-learned

こうも書ける

2010年12月5日日曜日

Page 79: 20101204 you-must-unlearn-what-you-have-learned

情報が多いのはどちらか

or

2010年12月5日日曜日

Page 80: 20101204 you-must-unlearn-what-you-have-learned

見覚えのある景色

2010年12月5日日曜日

Page 81: 20101204 you-must-unlearn-what-you-have-learned

コードで表現する

2010年12月5日日曜日

Page 82: 20101204 you-must-unlearn-what-you-have-learned

メソッドで表現すればいいんじゃ?

2010年12月5日日曜日

Page 83: 20101204 you-must-unlearn-what-you-have-learned

読めるけど分からない

2010年12月5日日曜日

Page 84: 20101204 you-must-unlearn-what-you-have-learned

大事なこと

2010年12月5日日曜日

Page 85: 20101204 you-must-unlearn-what-you-have-learned

読めると分かるは異なる

2010年12月5日日曜日

Page 86: 20101204 you-must-unlearn-what-you-have-learned

書いてあることがわかる(How)

読める

2010年12月5日日曜日

Page 87: 20101204 you-must-unlearn-what-you-have-learned

何をやりたかったかがわかる(Why)

分かる

2010年12月5日日曜日

Page 88: 20101204 you-must-unlearn-what-you-have-learned

読んだ人が理解し修正し使用することができること

良いコード

2010年12月5日日曜日

Page 89: 20101204 you-must-unlearn-what-you-have-learned

利用者側のコードが勝手に意味を持つ

ブロックならではの良さ

2010年12月5日日曜日

Page 90: 20101204 you-must-unlearn-what-you-have-learned

ここを書いているのは利用者

思わず意図を込めてしまう

2010年12月5日日曜日

Page 91: 20101204 you-must-unlearn-what-you-have-learned

http://www.flickr.com/photos/aslakr/14507479/2010年12月5日日曜日

Page 92: 20101204 you-must-unlearn-what-you-have-learned

ブロックが僕に教えてくれたこと

2010年12月5日日曜日

Page 93: 20101204 you-must-unlearn-what-you-have-learned

コードの良さについて

2010年12月5日日曜日

Page 94: 20101204 you-must-unlearn-what-you-have-learned

ブロックはそれをサポートしてくれている

2010年12月5日日曜日

Page 95: 20101204 you-must-unlearn-what-you-have-learned

ブロックはそれをサポートしてくれている

XRuby

2010年12月5日日曜日

Page 96: 20101204 you-must-unlearn-what-you-have-learned

“Rubyをキメると気持ち良い

 - まつもとゆきひろ RubyKaigi2008

2010年12月5日日曜日

Page 97: 20101204 you-must-unlearn-what-you-have-learned

“Joyful Ruby”2010年12月5日日曜日

Page 98: 20101204 you-must-unlearn-what-you-have-learned

I LOVE RUBY

私はRubyが大好きだ

24

2010年12月5日日曜日

Page 99: 20101204 you-must-unlearn-what-you-have-learned

弟子は師匠の鑑

2010年12月5日日曜日

Page 100: 20101204 you-must-unlearn-what-you-have-learned

Matz is niceso we are nice

2010年12月5日日曜日

Page 101: 20101204 you-must-unlearn-what-you-have-learned

良いと思う価値のための実践を続ける

2010年12月5日日曜日

Page 102: 20101204 you-must-unlearn-what-you-have-learned

Rubyの教えてくれたこと

島田 浩二[email protected]

— You must unlearn what you have learned.

2010年12月4日(土) 札幌Ruby会議03

2010年12月5日日曜日

Page 103: 20101204 you-must-unlearn-what-you-have-learned

ご清聴ありがとう

ございました2010年12月5日日曜日

Page 104: 20101204 you-must-unlearn-what-you-have-learned

提 供提 供

2010年12月5日日曜日