Skip to Content
Googleのソフトウェアエンジニアリング ―持続可能なプログラミングを支える技術、文化、プロセス
book

Googleのソフトウェアエンジニアリング ―持続可能なプログラミングを支える技術、文化、プロセス

by Titus Winters, Tom Manshreck, Hyrum Wright, 竹辺 靖昭, 久富木 隆一
November 2021
Intermediate to advanced
684 pages
10h 37m
Japanese
O'Reilly Japan, Inc.
Content preview from Googleのソフトウェアエンジニアリング ―持続可能なプログラミングを支える技術、文化、プロセス

8章スタイルガイドとルール

Shaindel Schwartz 著

Tom Manshreck 編

 ほとんどのエンジニアリング組織には、コードベースを統制するルールがある。ソースファイルが保存される場所についてのルール、コードの書式整形(formatting)についてのルール、命名、パターン、例外†1、スレッドについてのルールといったものだ。大多数のソフトウェアエンジニアは、どのように業務を遂行するかを統制するポリシーのセットの範囲内で作業している。Googleでは、コードベース管理のために、ルールを定義するスタイルガイドのセットを保守している。

†1 訳注:コード内で、エラーを含む、通常とは異なる処理を要するイベント。例外が発生した際に備え、例外を捕捉して処理する例外処理コードを用意する必要があり、プログラミング言語によってはそのための言語機能を用意している。

 ルールは法である。ルールは単なる提案や推奨ではなく、厳密で強制的な法だ。したがって、ルールは普遍的な強制力を持つ。使用の必要性に基づいて承認を得られた場合を除き、ルールは無視してはならない。ルールとは対照的に、ガイダンスは推奨事項やベストプラクティスを提供する。ガイダンスの個々の事項には従った方がよく、従うのが非常に望ましいことでさえある。だがルールと異なりガイダンスには通常、適用の度合いにばらつきの余地がある。

 我々は自分たちで定義したルール、つまりコードを書く際のやるべきこと・やってはいけないことで従わなければならないものを、プログラミングスタイルガイドとして集成しており、それがカノニカルなものとして扱われている。「スタイル」という言葉は、書式整形のプラクティスに限定して集めたものを示唆する、ここでは少々実態にそぐわないかもしれない名称である。我々のスタイルガイドはそれ以上のものであり、コードを統制する規定の全集なのだ。それは、我々のスタイルガイドが厳密に規定されているという話ではない。「できるだけ説明的で、常識の範囲内にある( ...

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

サイトリライアビリティワークブック ―SREの実践方法

サイトリライアビリティワークブック ―SREの実践方法

Betsy Beyer, Niall Richard Murphy, David K. Rensin, Kent Kawahara, Stephen Thorne, 澤田 武男, 関根 達夫, 細川 一茂, 矢吹 大輔, 玉川 竜司
初めてのSQL 第3版

初めてのSQL 第3版

Alan Beaulieu, 株式会社クイープ
プログラミングRust

プログラミングRust

Jim Blandy, Jason Orendorff, 中田 秀基
仕事ではじめる機械学習 第2版

仕事ではじめる機械学習 第2版

有賀 康顕, 中山 心太, 西林 孝

Publisher Resources

ISBN: 9784873119656Other