三津石智巳

👦🏻👦🏻👧🏻 Father of 3 | 🗺️ Service Reliability Engineering Manager at Rakuten Travel | 📚 Avid Reader | 👍 Wagashi | 👍 Caffe Latte | 👍 Owarai

「Refactoring: Improving the Design of Existing Code」感想

"I believe, however, that we can go beyond taste and say that the true test of good code is how easy it is to change it."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch01.xhtml

思いがけずリファクタリングを読み直すことに。やはりこれくらい言えるようになりたいものだ。

"A healthy code base maximizes our productivity, allowing us to build more features for our users both faster and more cheaply."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch01.xhtml

生産性の高いコードが最良。これは間違いない。

"As a result, when I’m refactoring, my code doesn’t spend much time in a broken state, allowing me to stop at any moment even if I haven’t finished."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

これ意外と理解されない。

"When I add functionality, I shouldn’t be changing existing code; I’m just adding new capabilities. I measure my progress by adding tests and getting the tests to work. When I refactor, I make a point of not adding functionality; I only restructure the code. I don’t add any tests (unless I find a case I missed earlier); I only change tests when I have to accommodate a change in an interface."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

うーん。やはりトレーニングプログラムを創るべきか。

"Without refactoring, the internal design—the architecture—of software tends to decay."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

そうなんだよ。

"Often, this future developer is myself."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

これもよく言うね。

"It reminds me of a statement Kent Beck often makes about himself: “I’m not a great programmer; I’m just a good programmer with great habits.” "

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

習慣が大事という話。

"In the end, all the earlier points come down to this: Refactoring helps me develop code more quickly."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

スピード!が大事なんだからリファクタリングはマスト。

"I refer to this effect as the Design Stamina Hypothesis [mf-dsh]: By putting our effort into a good internal design, we increase the stamina of the software effort, allowing us to go faster for longer. "

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

デザインスタミナ仮設

"Refactoring is something I do every hour I program."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

なかなかこうならないのはなぜなんだ。

"The best time to refactor is just before I need to add a new feature to the code base."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

むーん。どんどんリファクタリングすればいい。

"I do refactoring as part of adding a feature or fixing a bug. It’s part of my natural flow of programming."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

開発者のコンピテンシーとして定義すればいいのかな。

"But good developers know that, often, the fastest way to add a new feature is to change the code to make it easy to add. "

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

いい開発者の定義は絶対に必要だよな。採用、育成、評価にも使える。

"Of course, many managers and customer don’t have the technical awareness to know how code base health impacts productivity. In these cases I give my more controversial advice: Don’t tell!"

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

うけぽ。

"Software developers are professionals. Our job is to build effective software as rapidly as we can. My experience is that refactoring is a big aid to building software quickly."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

圧倒的正しさ。

"It’s only when I need to understand how it works that refactoring gives me any benefit."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

理解する必要のないものはリファクタリングはの必要もない。

"If you’re a tech lead in a team, it’s important to show team members that you value improving the health of a code base."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

Tech Leadには行動で示してほしい。

"But I think the most dangerous way that people get trapped is when they try to justify refactoring in terms of “clean code,” “good engineering practice,” or similar moral reasons."

 

via Check out this quote froくm Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

あーこれは大事だな。マネージャは特にモラルの問題にしてはいけない。仕組みを作らないといけない。

"The economic benefits of refactoring should always be the driving factor, and the more that is understood by developers, managers, and customers, the more of the “good design” curve we’ll see."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

この話は戦略マップにも通ずる。結局全てのプロセスは財務の視点につながるべき。そうでないと、説得ができない。

"CI and re-factoring work well together, which is why Kent Beck combined them in Extreme Programming."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

CIもしっかり勉強しないとな。

"This also answers those who are concerned that refactoring carries too much risk of introducing bugs. Without self-testing code, that’s a reasonable worry—which is why I put so much emphasis on having solid tests."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

テストがないリファクタリングはもちろんバグを生む。

"Usually, a system is only easy to put under test if it was designed with testing in mind—in which case it would have the tests and I wouldn’t be worrying about it."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

テストをかけるコードはテストを書くことを考慮されているコードだけ。

"The real impact of refactoring on architecture is in how it can be used to form a well-designed code base that can respond gracefully to changing needs. "

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

リファクタリングは変化に素早く対応できる良質のコードを生み出すこと。

"Adopting yagni doesn’t mean I neglect all upfront architectural thinking. There are still cases where refactoring changes are difficult and some preparatory thinking can save time. But the balance has shifted a long way—I’m much more inclined to deal with issues later when I understand them better. All this has led to a growing discipline of evolutionary architecture [Ford et al.] where architects explore the patterns and practices that take advantage of our ability to iterate over architectural decisions."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

これは出口治明さんが同じことを言っていると気がついた。

仕事の超基本48 正攻法でやり抜いてから、次を考える

See More: http://lnr.li/jROQX

日本人はこの表現のほうがわかりやすいと思う。

"The approach I describe here is a proven way to handle this complexity, but like any approach, it requires practice and skill."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

いかなるアプローチにもプラクティスとスキルが必要。

"The secret to fast software, in all but hard real-time contexts, is to write tunable software first and then tune it for sufficient speed."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

チューナブルコードにリファクタリングしてからチューニングする。

"The performance improvements are spread all around the program; each improvement is made with a narrow perspective of the program’s behavior, and often with a misunderstanding of how a compiler, runtime, and hardware behaves."

 

via Check out this quote from Refactoring: Improving the Design of Existing Code - https://learning.oreilly.com/library/view/refactoring-improving-the/9780134757681/ch02.xhtml

そうしないとパフォーマンスチューニングがあちらこちらにとっ散らかる。