Skip to Content
Tidy First? ―個人で実践する経験主義的ソフトウェア設計
book

Tidy First? ―個人で実践する経験主義的ソフトウェア設計

by Kent Beck, 吉羽 龍太郎, 永瀬 美穂, 細澤 あゆみ
December 2024
Beginner to intermediate
164 pages
1h 15m
Japanese
O'Reilly Japan, Inc.
Content preview from Tidy First? ―個人で実践する経験主義的ソフトウェア設計

16章分けて整頓する

今のところはプルリクエスト/コードレビューのモデルを使うと想定する(のちほど代替案について議論する)。整頓をどこに入れればよいだろうか?

以下は堂々巡りのひどい例だ。

  1. 整頓を振る舞いの変更と一緒に入れる。
  2. レビュアーはプルリクエストが長すぎると文句を言う。
  3. 整頓を独立したプルリクエストに分けて、振る舞いを変更する前にプルリクエストを出す(たぶんこちらだろう)、もしくは振る舞い変更のあとに回す。
  4. レビュアーは整頓のプルリクエストが無意味だと文句を言う。
  5. 1に戻る。

整頓はどこかに入れなければいけない。さもないと整頓しない。ではどこに入れればよいだろうか? 結論。整頓はそれ用のプルリクエストに入れる。整頓はプルリクエストごとにできるだけ少数にする。

もう少し詳しくトレードオフを見ていこう。整頓を学んでいる人たちには、同じような傾向が見られる。最初はただ変更するだけで、何も区別していない大量の変更から始める(図16-1)。

何も区別していない大量の変更

図16-1 何も区別していない大量の変更

ここで、ifステートメントを修正している途中で名前が間違っていることに気づき、それを直してからifステートメントに戻る。変更は変更だ。

整頓を学んだあとは、まるで顕微鏡のピントが合ったときのようになる。変更のいくつかはプログラムの振る舞いと属性に関するもので、プログラムを動かすとわかるものだ。だが、変更のなかには、プログラムの構造を変更しているものもある。このような変更はコードを見ないとわからない。 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Tidy First?

Tidy First?

Kent Beck
Fluent React

Fluent React

Tejas Kumar
Command-Line Rust

Command-Line Rust

Ken Youens-Clark

Publisher Resources

ISBN: 9784814400911Publisher Website