SlideShare une entreprise Scribd logo
1  sur  39
Télécharger pour lire hors ligne
リーダブルコードの
育て方
@1ntegrale9
リーダブルコードとは
もの部では説明不要のハズ
リーダブルコードとは
説明不要
ヤブルベカラズ
†聖書†
内容が頭に入っている
ヤブルベカラズ
†前提†
で話を進めます
簡単な振り返り
 画像元:いらすとや
 こちらを振り返っている男性の後ろ姿のイラストです。
三行で分かる
リーダブルコード
①コードを整列しよう
三行で分かるリーダブルコード
②コメントを書こう
三行で分かるリーダブルコード
③名前に気を付けよう
三行で分かるリーダブルコード
簡単!
読んだだけで書けるわけがない
 画像元:いらすとや
 機械のサポートで重たいものでも簡単に持ち上げられる、ロボットスーツ(パワードスーツ)を着ている中年男性のイラストです。
空白要る?改行要る?
ここコメント不要では?
この英単語で伝わる?
その命名規則は最適?
 画像元:いらすとや
 機械のサポートで重たいものでも簡単に持ち上げられる、ロボットスーツ(パワードスーツ)を着ている中年男性のイラストです。
様々なテクニックが
実装者のセンス次第
 画像元:いらすとや
 機械のサポートで重たいものでも簡単に持ち上げられる、ロボットスーツ(パワードスーツ)を着ている中年男性のイラストです。
簡単!
読んだだけで書けるわけがない
最初は誰しも
アンリーダブル
 画像元:いらすとや
 先の尖った鉛筆を怖がっている、先端恐怖症の男性のイラストです。
修正を重ねて
リーダブルに!
 画像元:いらすとや
 昔の映画に出てくるような、コンピューターから出てきた穴の空いた紙テープを解読している科学者(博士)のイラストです。
コードを修正する人
① 指摘を受けた自分
② 気付いたメンバー
③ 気付いた未来の自分
ぶっちゃけ
クソコードの修正は
誰しもめんどくさい
でもクソコードは
できれば直したい
すぐに直せそうなら
つい直しちゃう人
いますよね?
すぐに直せるコード
を書こう
自浄作用のあるコード
を書こう
 画像元:いらすとや
 川の水などを浄化・消毒して水道で使えるようにするための施設、浄水場のイラストです。
リファクタブルコード
を書こう
爆速で
リファクタ
する話
テキストエディタ
活用してますか?
テキストエディタ
活用してますか?
SublimeText
活用してますか?
一括編集機能
活用してますか?
例:SublimeTextでリファクタに使うコマンド
複数行カーソル
指定文字列の全選択
行のコピー/削除
行の上下移動
1行コメント
ブロックコメント  
alt+ドラッグ
⌘+Ctrl+G
⌘+Shift+D/K
⌘+Ctrl+↑↓
⌘+/
⌘+alt+/
リファクタブル
コードの条件
①形式が統一されている
リファクタブルコードの条件
②名前がユニークである
リファクタブルコードの条件
③名前が部分一致しない
リファクタブルコードの条件
まとめ
SublimeTextはいいぞ恋に落ちよう
SublimeTextはいいぞ言いたいのは山々だが
可読性は保守性に
付いてくる!
リーダブルコードの育て方

Contenu connexe

En vedette

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 

En vedette (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

リーダブルコードの育て方