Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
リーダブルなPHPDocを目指して / Aiming for a readable PHPDoc
Search
Masato Nishihara
July 06, 2021
Technology
57
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
リーダブルなPHPDocを目指して / Aiming for a readable PHPDoc
2021/7/7に開催されたリーダブルコード LT会 - vol.2で発表したスライドです。
Masato Nishihara
July 06, 2021
More Decks by Masato Nishihara
See All by Masato Nishihara
ウォーターフォールとアジャイルと楽楽明細/Waterfall×Agile×Rakurakumeisai
whitefox_73
1
940
14年目のサービスと今後も歩むためのリファクタリング戦略
whitefox_73
0
1.9k
正攻法はあるのか!?泥臭く戦ったNode.jsバージョンアップ一部始終
whitefox_73
4
6.3k
Other Decks in Technology
See All in Technology
人間はどの意思決定を手放せるのか
kawasima
15
7.2k
HRC_Frontend_Conference_Fukuoka_2026.pdf
ts020
0
740
2026-09-11 【Snowflake World Tour Tokyo 2026】Snowflakeを起点に、AI Agentが自律稼働し続ける未来へ / Driving AI Agents with Snowflake
civitaspo
0
690
AIに任せた品質は、誰が見立てるのか - AI時代のテストマネジメント
nakanao
3
2.1k
事業課題から技術的負債に向き合う
sansantech
PRO
2
1.9k
TinyGo 開発サイクルを高速化する:Go で作るエミュレータ入門
zozotech
PRO
1
740
beyond jj: config & tools ecosystem
indirect
0
3k
CLIライブラリ開発を支える技術
htnabe
0
120
空間オーディオで過去の 自分(ゴースト)と競うランニング 〜HealthKitのルートを足音に変える実装〜
nao_randd
0
230
30座EKS, 180次升級淬煉的EKS Upgrade Skill 的歷程
eric8230
0
170
目の前の楽しいが人生を変える - コミュニティの螺旋の歩き方と楽しむコツ / change your life
soudai
PRO
5
640
顧客に向き合う開発組織へ。リアーキテクチャとフィーチャーチーム化で挑む組織改革
safie
0
2k
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
Documentation Writing (for coders)
carmenintech
77
5.5k
The Curse of the Amulet
leimatthew05
3
15k
Speed Design
sergeychernyshev
33
2.1k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
The Pragmatic Product Professional
lauravandoore
37
7.4k
Done Done
chrislema
186
16k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
How GitHub (no longer) Works
holman
316
150k
Transcript
#readablelt ©2021 RAKUS Co., Ltd. リーダブルな PHPDocを目指して 株式会社ラクス 西原 優人
#readablelt 自己紹介 経歴 • 2015年に新卒でラクスに入社 • 「Mail Dealer」や「Chat Dealer」の開発を経 て現在は「配配メール」の開発担当
良く触る技術 • PHP • JavaScript • Node.js • PostgreSQL 西原 優人 (masato nishihara) Twitter : whiteFox_73 趣味 • アウトドア フットサル/スノーボード/バイク /ペンギン • インドア 音楽鑑賞/ゲーム/ ペンギン
#readablelt 配配メールとは • メールマーケティングに必要な機能を備えたメール配信サービス • マーケティングオートメーションツールを備えたプランもある • 現在サービス開始から15年目
#readablelt 2月にあったRAKUSMeetUpにて Speaker Deck https://speakerdeck.com/whitefox_73/14nia n-mu-falsesabisutojin-hou-mobu-mutamefal serihuakutaringuzhan-lue logmi Tech https://logmi.jp/tech/articles/323993
※テキストで当日の発表内容が紹介されています
#readablelt 今回の内容は またリファクタリングの話になります
#readablelt 今回の内容は プログラムには影響しないけど 重要なコメントPHPDocについてです
#readablelt 今回の内容は PHPDocとはPHPで書かれたのクラスや関数などの ブロックに記述できるDocComment内に記述する書式
#readablelt 今回の内容は 実際のイメージ
#readablelt 今回の内容は PHPDocの書き方に関しては弊社ブログにもまとめています 型を使いこなすためのPHPDocの書き方 https://tech-blog.rakus.co.jp/entry/20210326/php#PHPDo c%E3%81%A8%E3%81%AF 同じチームの後輩が書いてくれました !!
#readablelt 今回の内容は 無法地帯となっていたPHPDocを メンテしましたって話
#readablelt メンテされてないとはどんな状態だった? 一つ目
#readablelt メンテされてないとはどんな状態だった? 書いてない…
#readablelt メンテされてないとはどんな状態だった? 二つ目
#readablelt メンテされてないとはどんな状態だった? フォーマット違 う…
#readablelt メンテされてないとはどんな状態だった? 三つ目
#readablelt メンテされてないとはどんな状態だった? 型違うやん…
#readablelt メンテされてないとはどんな状態だった? 3つ問題点がありましたが、一番ヤバいのは3つ目 • PHPDocが書かかれている関数と書かれていない関数が混在 • PHPDocの書き方が統一されていない • PHPDocに書かれている内容が正しくない事がある PHPDocは真実と嘘が織り交ざっており、まるで詐欺師状態
#readablelt なんでメンテしようと思ったの? • チームメンバーの入れ替わりで経験則でカバーできなくなってきた • 生産性を上げる為に、無駄な時間を使いたくなかった • 役に立っていないPHPDocが勿体ない
#readablelt どうやってメンテした? 3段階でメンテナンスを実施 • PHPDocの修正 ◦ 過去の誤ったPHPDocをあるべき姿に • ルール作成 ◦
現在進行形で誤った PHPDocが増えないように • ルール定着 ◦ 未来もPHPDocが綺麗に維持できるように
#readablelt どうやってメンテした? PHPDocの修正 • PHPDocを書く対象の関数は数千個以上… • まずは利用頻度の高い共通関数から対応 • 業務の合間に改善施策として長期的に取り組んで対応
#readablelt どうやってメンテした? ルール作成 • コーディングルールにPHPDocに関する項目を追加 • ルールをチーム内に展開し、PHPDocの認識を合わせる
#readablelt どうやってメンテした? ルール定着 • ルール定着の為、PHPDocもコードレビュー対象 • チーム内にも共有しレビューを徹底してもらう
#readablelt 効果はあった? • コードレビューや調査の際に、PHPDocを信頼できるようになった • IDEの補完が効くようになった • IDEで誤った不要な警告がでなくなった
#readablelt 取り組んでの所感 • 無法地帯だったPHPDocをメンテした • メンテを怠ると正常な状態に戻すのがとても大変 • 信頼できるPHPDocである事が大切 • IDEの恩恵も受けることが出来て良いことばかり
#readablelt サボらずにPHPDocをメンテしましょう