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
jest introduction
Search
Ryota Matsunaga
February 01, 2021
290
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
jest introduction
Ryota Matsunaga
February 01, 2021
More Decks by Ryota Matsunaga
See All by Ryota Matsunaga
jest introduction
mats0000
0
190
Featured
See All Featured
Optimizing for Happiness
mojombo
378
71k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
230
ラッコキーワード サービス紹介資料
rakko
1
4.9M
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Designing Powerful Visuals for Engaging Learning
tmiket
1
540
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
490
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Faster Mobile Websites
deanohume
310
32k
The browser strikes back
jonoalderson
0
1.7k
Transcript
カンファレンス 松永遼太
今⽇話すこと カンファレンスの発表 話さないこと Youtube チャンネルについて
発表内容 実はkamithonさんにリーダブルコードについての発表を勧められていました。 ただ、僕のコードすでに結構読みやすいと思うので 今⽇は HEAP についての発表をします!
冗談です!冗談です! ✌ では、リーダブルコードについての発表始めます
優れたコード 読みやすいコード エンジニアはコードを読む事が⾮常に多いから 他⼈が最短で理解できるコードでなければならない 短い⽅がいいけど、理解するまでにかかる時間を短くするほうが ⼤切 > ⾼度な⽂法 ステップ数が少ない スマート
変数名に情報を詰め込む • Get ではなくfetchやdownload など明確な単語を使う • Temp, returnVal, val, x,
yなどは避ける • 変数名のフォーマット • 限界値を含める時はmin, maxを使う • 範囲を指定する時はfirst、lastを使う • ブール値ではis、hasを使う (マンション) https://github.com/geo-logic/geologic-admin/pull/1580
すぐれたコードは⽬に優しいものでなけ ればいかない 3つの原則 1. ⼀貫性のあるレイアウト 2. 似ているコードは似ているように⾒せる (FullCustom & CustomGeo)
3. 関連するコードをまとめてブロックにする (Office) https://github.com/geo-logic/geologic-admin/pull/1547
明⽇からあなたも読みやすいコードを書こう! すぐ実践できる編 三項演算⼦にこだわらない - コードを短くできるけど、読みにくくなるケースもある ネストを浅くする - ネストすればするほど読みにくくなる ⼀つの関数でやりすぎない (Office)
- ⼀度に複数の事をやるコードは理解しにくい。
Youtube https://www.youtube.com/watch?v=XlxMSL9qMn4