Submit Search
Upload
命名の話(ソースコードは読み物です)
•
2 likes
•
1,588 views
Akihiro Nakahara
Follow
Report
Share
Report
Share
1 of 43
Download now
Download to read offline
Recommended
Livedoor blog
Livedoor blog
yuka
Pf部第24回資料
Pf部第24回資料
daye001
アジャイルサムライ横浜道場「リファクタリング:技術的負債の返済」
アジャイルサムライ横浜道場「リファクタリング:技術的負債の返済」
Hiroyuki Ohnaka
アジャイルテスティング
アジャイルテスティング
Shuji Watanabe
レガシーコードを改善した先にあるもの、それは継続的インテグレーション
レガシーコードを改善した先にあるもの、それは継続的インテグレーション
Masanori Satoh
クラスとクラスの依存を薄くする
クラスとクラスの依存を薄くする
Akihiro Nakahara
エクストリームエンジニア5
エクストリームエンジニア5
T-arts
今日からはじめるリファクタリング
今日からはじめるリファクタリング
Junya Shimazu
Recommended
Livedoor blog
Livedoor blog
yuka
Pf部第24回資料
Pf部第24回資料
daye001
アジャイルサムライ横浜道場「リファクタリング:技術的負債の返済」
アジャイルサムライ横浜道場「リファクタリング:技術的負債の返済」
Hiroyuki Ohnaka
アジャイルテスティング
アジャイルテスティング
Shuji Watanabe
レガシーコードを改善した先にあるもの、それは継続的インテグレーション
レガシーコードを改善した先にあるもの、それは継続的インテグレーション
Masanori Satoh
クラスとクラスの依存を薄くする
クラスとクラスの依存を薄くする
Akihiro Nakahara
エクストリームエンジニア5
エクストリームエンジニア5
T-arts
今日からはじめるリファクタリング
今日からはじめるリファクタリング
Junya Shimazu
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
More Related Content
Featured
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Featured
(20)
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
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 2024
Social 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 2024
5 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
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 Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The 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...
命名の話(ソースコードは読み物です)
1.
命名の話
ソースコードは読み物です 2012/09/28 Fri @Ew Developer Mtg Akihiro Nakahara
2.
皆さんソースコード書いてます
よね?
3.
ソースコードを書いている時に
4.
後でそのソースコードを
5.
誰かが読むかも?
6.
って、思ってま す?
7.
1ヶ月後に自分じゃない誰かが そのソースコードを読んでいる
姿を想像してます?
8.
してない?
9.
10.
ダメDeath
11.
ソースコードは 読み物です
12.
みなさんソースコード読んでま
すよね?
13.
読みにくいソースコードはクソで
しょ?
14.
だったら、本などの読み物と同
じ様に
15.
誰もが読めるように書くべき
16.
ソースコードは人間が読みます
17.
あなた以外の人が読みます
18.
あなた以外の人が読み
ます
19.
ソースコードは誰もが読めるよ
うに書きましょう
20.
そこで重要なのが名前
21.
変数名、メソッド名、クラス名、 テーブル名、カラム名・・・
22.
変数名
23.
ソースコード If flg Then
file.Delete() End If
24.
頭の中 「flgがTrueの時、ファイルを削
除する」
25.
flgってなに?
エフエルジー? flgがTrueの時って、0時0分0秒 の時?
26.
想像するのめんどくさっ
27.
「flg」は意味の無い名前
28.
その変数が何を意味している
か分かる様に 名前を付けましょう
29.
flgの名前を変える
30.
ソースコード If isFileExists Then
file.Delete() End If
31.
ただこれだけで読み易くなる
32.
変数名の長さ
33.
変な短縮して意味不明になる
のならば
34.
長くなっても良いので意味が分
かる名前にする
35.
短くてわかり難くなるよりも 長くてもわかり易い方が良いと
思います
36.
メソッド名、クラス名も一緒
37.
ソースコードは読み物で
す
38.
あなた以外の人が読み
ます
39.
読みにくいソースコード
はクソです
40.
読み易くするには
41.
命名重要
42.
常に意識して名前を 付けましょう!
43.
ありがとうございました
Download now