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
リーダブルコード読書会 #1
Search
Kenta Enomoto
July 17, 2014
Programming
0
250
リーダブルコード読書会 #1
社内リーダブルコード読書会 #1
Kenta Enomoto
July 17, 2014
Tweet
Share
More Decks by Kenta Enomoto
See All by Kenta Enomoto
Introducing Pkl
enomotok
0
59
iOS リポジトリへの Renovate の導入
enomotok
2
260
iOS開発とGitLab CI
enomotok
7
4k
ポモドーロテクニックについて
enomotok
0
90
Other Decks in Programming
See All in Programming
上手な探索的テストとその上達方法について
matsu802
4
650
AppDeveloperCon 2024 EU: Building polyglot developer experiences in 2024
salaboy
0
380
Laravel標準バリデーションでできること
hmb_ok
2
360
自動テスト実行結果の目的を整理する / Organizing objectives of automated test results
twada
PRO
10
2.1k
LPIXEL×CADDi_kaerururu
kaerururu
3
300
incrementalモデルの理解を深める
ikkimiyazaki
2
640
The Future of C++ Interoperability: Insights from Porting a Game to Swift
teamhimeh
0
270
Go1.22からの疑似乱数生成器について/go-122-pseudo-random-generator
convto
1
160
Swiftの型推論を学ぼう | Let's Learn About Type Inference in Swift
omochi
2
510
デザインシステムで Tailwind CSSとCSS in JSに分散投資をしたら良かった話
fsubal
14
3.2k
どうしてこうなった命名集 ~🔥編~ / OOC 2024 LT
pictiny
4
2.8k
Deep Dive 大規模システムアーキテクチャ/開発組織エンジニアリング / Deep Dive Large-Scale System Architecture, Development Organization Engineering
nrslib
15
2.9k
Featured
See All Featured
Docker and Python
trallard
33
2.6k
Fantastic passwords and where to find them - at NoRuKo
philnash
35
2.4k
Stop Working from a Prison Cell
hatefulcrawdad
265
19k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.8k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
6
950
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
272
12k
What the flash - Photography Introduction
edds
64
11k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
1
3.3k
The Invisible Side of Design
smashingmag
293
49k
Web development in the modern age
philhawksworth
201
10k
How GitHub Uses GitHub to Build GitHub
holman
467
290k
Transcript
Ϧʔμϒϧίʔυಡॻձ
͓ू·Γ͍͖ͨͩ͋Γ͕ͱ͏ ͍͟͝·͢ɻ
w ಡॻձͷత w Ϧʔμϒϧίʔυʹ͍ͭͯ w ಡॻձͷਐΊํ ͓͠ͳ͕͖
ಡॻձͷత
w ྑ͍ίʔυͷॻ͖ํΛʹ͚ͭΔ w ʑͷษڧͷ͕͔Γʹ ಡॻձͷత
w ྑ͍ίʔυͷॻ͖ํΛʹ͚ͭΔ w ʑͷษڧͷ͕͔Γʹ w ϓϩάϥϛϯάʹ͍ͭͯؾܰʹͤΔ ಡॻձͷతʢͦͯ͠ཪςʔϚʣ
Ϧʔμϒϧίʔυʹ͍ͭͯ
None
ಡΈ͍͢ίʔυͷॻ͖ํΛ ղઆͨ͠ຊ
ίʔυίϯϓϦʔτͷ༰Λ ؆୯ʹ·ͱΊͨͷʁ
ɺͷίϯϐϡʔ λؔ࿈ॻ੶ͷؒച্Ґ ʢδϡϯΫಊௐʣ
ϦʔμϒϧίʔυͰ͍͏ ʮྑ͍ίʔυʯͬͯʁ
ͦΕ ʮཧղ͍͢͠ίʔυʯ
Qཁม ! if (request.user.id == document.owner_id) {! // Ϣʔβ͜ͷจॻΛฤू͢Δ! }!
! …! ! if (request.user.id != document.owenr_id) {! // จॻಡΈऔΓઐ༻! }
Qཁม ! if (request.user.id == document.owner_id) {! // Ϣʔβ͜ͷจॻΛฤू͢Δ! }!
! …! ! if (request.user.id != document.owenr_id) {! // จॻಡΈऔΓઐ༻! }
Qཁม ! if (request.user.id == document.owner_id) {! // Ϣʔβ͜ͷจॻΛฤू͢Δ! }!
! …! ! if (request.user.id != document.owenr_id) {! // จॻಡΈऔΓઐ༻! } ! final boolean user_owns_document = (request.user.id == document.owner_id);! ! if (user_owns_document) {! // Ϣʔβ͜ͷจॻΛฤू͢Δ! }! ! …! ! if (!user_owns_document) {! // จॻಡΈऔΓઐ༻! }
if (!(file_exists && !its_protected)) Error("Sorry, could not read file."); QυɾϞϧΨϯͷ๏ଇΛ͏
QυɾϞϧΨϯͷ๏ଇΛ͏ if (!(file_exists && !its_protected)) Error("Sorry, could not read file.");
if (!file_exists || is_protected) Error("Sorry, could not read file.");
ಡॻձͷਐΊํ
͡ΊΑ͏