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
Go Code Review Comment を翻訳した話
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Kenshi Kamata
June 01, 2017
Programming
7.6k
0
Share
Go Code Review Comment を翻訳した話
Kenshi Kamata
June 01, 2017
More Decks by Kenshi Kamata
See All by Kenshi Kamata
500万ユーザーを支える残高の冪等性 / The idempotency of the balance for 5 million Merpay users
knsh14
0
3k
チャネルの仕組み
knsh14
6
5.6k
Go1.10 strings.Builder の紹介
knsh14
2
1.4k
Go でインタプリタを 書いてみよう
knsh14
0
3k
Let’s Create An Interpreter In Go
knsh14
0
150
tvOS Leaderboard
knsh14
0
1.2k
Other Decks in Programming
See All in Programming
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
670
cloudnative conference 2026 flyle
azihsoyn
0
160
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
140
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
1
680
GoogleCloudとterraform完全に理解した
terisuke
1
190
when storing skills in S3 file
watany
3
1.5k
Structured Concurrency, Scoped Values and Joiners in the JDK 25 26 27
josepaumard
1
150
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
200
My daily life on Ruby
a_matsuda
3
200
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
400
【26新卒研修】OpenAPI/Swagger REST API研修
dip_tech
PRO
0
150
AI時代だからこそ「Bloc」を採用する価値があるのかもしれない
takuroabe
0
130
Featured
See All Featured
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
It's Worth the Effort
3n
188
29k
Paper Plane (Part 1)
katiecoart
PRO
0
7.3k
Building the Perfect Custom Keyboard
takai
2
750
Bash Introduction
62gerente
615
210k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
[SF Ruby Conf 2025] Rails X
palkan
2
1k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Transcript
Go Review Comment を翻訳した話 Golang Tokyo #6 鎌田健史 ( @knsh14
)
自己紹介 • 鎌田健史 • @knsh14 • KLab 株式会社 エンジニア ◦
Unity でプロト作ったりツール作った り ◦ Javascript でゲーム作ったり • Go 歴2年位
今日の要旨 • みんな Go Code Review Commentsを読もう! ◦ 転ばぬ先の杖を持とう ◦
読んだら次は Effective Goへ! • みなさんも翻訳してみて欲しい! ◦ 勉強の効率めっちゃいい
Go Code Review Commentsとは? https://github.com/golang/go/wiki/CodeReviewComments • コードレビューする際にまずは見るべき箇所をまとめたもの • Effective Go
を更に簡単にしたもの ◦ Go 版リーダブルコード • ありがちな話をまとめたもので、スタイルガイドではない ◦ 必ずしも従う必要もないし無理する必要はない
で翻訳を書きました http://qiita.com/knsh14/items/8b73b31822c109d4c497 • それなりに原文に忠実に訳したつもり ◦ 一部英語力の問題で意味不明な部分もある • なるべく原文に追従する努力 ◦ 3月くらいに見直したら更新されてたので慌てて追記
◦ Context の項もあるよ!
翻訳を書くきっかけ とある社内ツールを Go で書いて レビューお願いしたところ ボッコボコのフルボッコにされる
翻訳を書くきっかけ その時に渡されたのが Code Review Comments だった とりあえず読んだ証拠に自分で翻訳してみることに 3日くらいで全部訳しきった tenntenn に一通り読んでもらって手直ししたあと公開
翻訳してみてよかった • 業務でガリガリ書いているわけじゃないので、初学者の僕に とってはこういういきなり正解のパターンを勉強できるのは効 率が良かった • 自分で言葉に書き起こす分脳みそを使う • 英語の勉強にもなったので他の英語書籍に挑戦するハードル も下がった
もうちょっと中身を詳しく
幾つかのカテゴリに分けられる • コードの見た目を改善 ◦ Gofmt, Mixed Caps… • コメント、文章の体裁 ◦
Comment Sentences, Error String... • tips 系 ◦ Declaring Empty Slices, Named Result Parameters... • 設計の指針 ◦ Receiver Type, Don’t Panic...
コードの見た目を改善 大体はツールでなんとかしようぜな話 gofmt, goimports, golint あたりを使っておけばまず大丈夫 特に golint はめちゃくちゃ優秀
コメントや文章の体裁 コード内の文章の書き方などに関するアドバイス 「説明するものの名前で始めてピリオドで終わりましょう」なんてい うかなり具体的な説明もある 特に Error String で紹介されている「エラーで返すときの文字列 は大文字始まりにしない」はかなり意外だった
tips 系 Declaring Empty Slices や、Named Result Parameters など 間違いではないけどよりよい方法を紹介してくれるパターン
var t []string と t := []string{} の使い分けは意識して書かないと 結構やらかしてることが多そう
設計の指針になるようなもの Receiver Type はぜひ一度読んでみてほしい レシーバーを ポインタにするかどうか迷ったときの指標になる 基本的にはポインタで問題ないけれど、幾つかのパターンにハマ るときはそうでないほうがいい時もある
最後に • 良いドキュメントの翻訳はめっちゃ勉強になるので積極的に やっていきたい • Code Review Comment はぜひ皆さん目を通して欲しい! ◦
そのために日本語で訳したので