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
Yohei Munesada
November 05, 2015
Technology
6
15k
ビギナーズ_レビューから学ぶ+1
第13回HTML5ビギナーズ。ソースレビューを半年以上していて、その内容をまとめました。「バグがなくて読みやすい」がポイント。
Yohei Munesada
November 05, 2015
Tweet
Share
More Decks by Yohei Munesada
See All by Yohei Munesada
G'sデータベース設計の講義
yoheimune
4
5.2k
How to create a service, How to google !
yoheimune
0
280
Machine Learning Basic and Python
yoheimune
1
480
Python Scraping and Web Apps for G's ACADEMY TOKYO
yoheimune
0
220
DevelopWorkflow and Solving Problems
yoheimune
0
420
Git and Github for Beginners
yoheimune
1
280
Data Science BOOTCAMP Practices - Recommendation
yoheimune
0
190
Data Science BOOTCAMP Practices
yoheimune
0
350
Machine Learning with Python
yoheimune
0
310
Other Decks in Technology
See All in Technology
AWS Community Builderのススメ - みんなもCommunity Builderに応募しよう! -
smt7174
0
180
AWSサービスアップデート 2024/12 Part3
nrinetcom
PRO
0
140
機械学習を「社会実装」するということ 2025年版 / Social Implementation of Machine Learning 2025 Version
moepy_stats
5
1.3k
JuliaTokaiとJuliaLangJaの紹介 for NGK2025S
antimon2
1
120
カップ麺の待ち時間(3分)でわかるPartyRockアップデート
ryutakondo
0
140
JAWS-UG20250116_iOSアプリエンジニアがAWSreInventに行ってきた(真面目編)
totokit4
0
140
CDKのコードレビューを楽にするパッケージcdk-mentorを作ってみた/cdk-mentor
tomoki10
0
210
あなたの知らないクラフトビールの世界
miura55
0
130
【JAWS-UG大阪 reInvent reCap LT大会 サンバが始まったら強制終了】“1分”で初めてのソロ参戦reInventを数字で振り返りながら反省する
ttelltte
0
140
デジタルアイデンティティ技術 認可・ID連携・認証 応用 / 20250114-OIDF-J-EduWG-TechSWG
oidfj
2
690
2025年のARグラスの潮流
kotauchisunsun
0
800
深層学習と3Dキャプチャ・3Dモデル生成(土木学会応用力学委員会 応用数理・AIセミナー)
pfn
PRO
0
460
Featured
See All Featured
A better future with KSS
kneath
238
17k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.4k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.7k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Six Lessons from altMBA
skipperchong
27
3.6k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.5k
GitHub's CSS Performance
jonrohan
1030
460k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
192
16k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
For a Future-Friendly Web
brad_frost
176
9.5k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Transcript
https://flic.kr/p/7g1xov ιʔεϨϏϡʔ͔ΒֶͿ +BWB4DSJQU )5.-ϏΪφʔζ .VOFTBEB:PIFJ
About me 㾎 फఆ༸ฏ 㾎 גࣜձࣾϒοΫςʔϒϧ 㾎 !ZPIFJ.VOF 㾎 IUUQXXXZPIFJNOFU
㾎 )5.-ϏΪφʔζελοϑ 㾎 δʔεΞΧσϛʔϝϯλʔ 㾎 ࠷ۙͷڵຯɿ1ZUIPO ػցֶश ֶ ౷ܭ
㾎 εϚϗ͚ిࢠॻ੶αΠτ 㾎 IUUQTEPLVTIPPKJLBOKQUPQ ✓ jQuery, Handlebars ✓ Single Page
Architecture ಡॻͷ͓࣌ؒͰ͢
1PJOUPG7JFX ϨϏϡʔͰݟ͍ͯΔϙΠϯτʁ
1PJOUPG7JFX όά͕ͳͯ͘ಡΈ͍͢
1PJOUPG7JFX όά͕ͳͯ͘ಡΈ͍͢
1PJOUPG7JFX όά͕ͳͯ͘ಡΈ͍͢ νʔϜͷ
όά͕ͳ͍ίʔυʁ
όά͕ͳ͍ ᶃ༷௨Γʹಈ͘ w ༷ͷ௨Γʹಈ͘ w ແବͳ͜ͱ͠ͳ͍ w ͋Γ͑ΔΤϥʔέʔεʹରԠ͍ͯ͠Δ
ᶄ Ћ কདྷతʹόάʹͳΓͮΒ͍ w ࠓޙ͋Γͦ͏ͳมߋʹ͑͏ΔઃܭͰ͋Δ w ࠓ࣮͢Δඞཁͳ͍͚Ͳ
༷௨Γʹಈ͘ model.book.fetchOne = function (bookName, callback) { var url =
'/api/book/search'; var params = {name: bookName}; api(url, params).then(function (books) { callback(books[0]); }); }
ແବͳ͜ͱ͠ͳ͍όά͕ͳ͍ // OK model.book.fetchOne = function (bookName, callback) {
var url = '/api/book/search'; var params = {name: bookName}; api(url, params).then(function (books) { callback(books[0]); }); }
ແବͳ͜ͱ͠ͳ͍όά͕ͳ͍ // NG model.book.fetchOne = function (bookName, callback) {
var url = '/api/book/search'; var params = {name: bookName}; api(url, params).then(function (books) { $(‘.mypage #btn’).addClass('enable'); ແବͳ͜ͱ callback(books[0]); }); }
ΤϥʔέʔεʹରԠ͍ͯ͠Δόά͕ͳ͍ model.book.fetchOne = function (bookName, callback) { var url
= '/api/book/search'; var params = {name: bookName}; api(url, params).then(function (books) { callback(books[0]); }); }
ΤϥʔέʔεʹରԠ͍ͯ͠Δόά͕ͳ͍ model.book.fetchOne = function (bookName, callback) { var url
= ‘/api/book/search'; // 1. bookName͕ະࢦఆʁ var params = {name: bookName}; api(url, params).then(function (books) { // 2. ݕࡧ݁Ռͳ͠ʢnull͕ฦͬͯ͘Δʣʁ // 3. callback͕ະࢦఆʁ callback(books[0]); }); }
ΤϥʔέʔεʹରԠ͍ͯ͠Δόά͕ͳ͍ model.book.fetchOne = function (bookName, callback) { var url
= ‘/api/book/search'; // 1. bookName͕ະࢦఆʁ => ࠓճؾʹ͠ͳ͍ var params = {name: bookName}; api(url, params).then(function (books) { // 2. ݕࡧ݁Ռͳ͠ʢۭͷྻ͕ฦͬͯ͘Δʣ=> nullνΣοΫ // 3. callback͕ະࢦఆʁ => ؾʹ͠ͳ͍ callback(books && books[0]); }); }
ࠓޙͷมߋʹڧ͍όά͕ͳ͍ model.book.fetchOne = function (bookName, callback) { var url
= '/api/book/search'; var params = {name: bookName}; api(url, params).then(function (books) { callback(books[0]); }); }
ࠓޙͷมߋʹڧ͍όά͕ͳ͍ // ύϥϝʔλ͕૿͑Δʁ model.book.fetchOne = function (bookName, callback) {
var url = '/api/book/search'; var params = {name: bookName}; api(url, params).then(function (books) { callback(books[0]); }); }
ࠓޙͷมߋʹڧ͍όά͕ͳ͍ // ύϥϝʔλ͕૿͑Δʁ => ҾΛՃ͢Δ model.book.fetchOne = function (name,
callback, genre, author) { var url = '/api/book/search'; var params = {name: bookName}; api(url, params).then(function (books) { callback(books[0]); }); }
ࠓޙͷมߋʹڧ͍όά͕ͳ͍ // ύϥϝʔλ͕૿͑Δʁ model.book.fetchOne = function (name, callback, genre,
author) { var url = '/api/book/search'; var params = {name: bookName}; api(url, params).then(function (books) { callback(books[0]); }); }
ࠓޙͷมߋʹڧ͍όά͕ͳ͍ // ύϥϝʔλ͕૿͑Δʁ => ෳࢦఆՄೳʹ model.book.fetchOne = function (conditions,
callback) { var url = '/api/book/search'; api(url, conditions).then(function (books) { callback(books[0]); }); } // ͍ํ model.book.fetchOne({name:’φϧτ’}, callback: function () {});
3Fɿόά͕ͳ͍ ᶃ༷௨Γʹಈ͘ w ༷ͷ௨Γʹಈ͘ w ແବͳ͜ͱ͠ͳ͍ w ͋Γ͑ΔΤϥʔέʔεʹରԠ͍ͯ͠Δ
ᶄ Ћ কདྷతʹόάʹͳΓͮΒ͍ w ࠓޙ͋Γͦ͏ͳมߋʹ͑͏ΔઃܭͰ͋Δ w ࠓ࣮͢Δඞཁͳ͍͚Ͳ
ಡΈ͍͢ίʔυ https://flic.kr/p/aAvh9L
ಡΈ͍͢ίʔυʁ
ಡΈ͍͢ίʔυʁ ຊޠͷจষͱಉ͡
͡Ό͕ͷ࡞Γํ δϟΨΠϞͱਓࢀେ͖ΊͷཚΓʹͯ͠ۄͶ͗͘͠Γɺ͠ Β͖ͨચͬͯదʹ͖Γ·͢ɻத՚ುʹ༉Λେ̎ೖΕڧՐʹ͠ɺ ΛೖΕ৭͕มΘΔ·ͰᖱΊͨΒ̍ೖΕܰ͘ᖱΊ·̇ࣽ͢ोͷ ࡐྉΛೖΕಅͨ͠ΒփोΛऔΓനୌΛೖΕࠞͥதڧՐͷ··མ ֖͠Λࣽ͠ो͕ແ͘ͳΔ·Ͱఔࣽ٧Ί·͢ɻࣽ٧Ί ͨॴͰҰࠞͥɺ࠶མ֖͠Λͯࣽ͠ो͕ͳ͘ͳΔ·Ͱ༷ࢠΛݟ ͳ͕ΒߋʹҐࣽ٧Ί͍͖ͯ·͢ɻࣽो͕ແ͘ͳͬͨΒՐΛࢭ Ίམ֖͠Λͨ͠··ؒɺৠΒ͠·̇͢ຯ͕ߋʹછΈࠐΈ· ͢ΐʂ͜͜େࣄʂͦͯ͠Ͱ̇͢
ʼʻɻɻɻ http://cookpad.com/recipe/1519259
͡Ό͕ͷ࡞Γํ Լ४උ ɹδϟΨΠϞେ͖ΊͷཚΓʹͯ͠ۄͶ͗͘͠Γɺ͠Β͖ͨચͬͯదʹ͖Γ·͢ɻ ᖱΊΔ ɹத՚ುʹ༉Λେ̎ೖΕڧՐʹ͠ɺΛೖΕ৭͕มΘΔ·ͰᖱΊͨΒ̍ೖΕܰ͘ᖱΊ·̇͢ ࣽΔ ɹࣽोͷࡐྉΛೖΕಅͨ͠ΒփोΛऔΓനୌΛೖΕࠞͥதڧՐͷ··མ֖͠Λࣽ͠ो͕ແ͘ͳΔ·Ͱ ఔࣽ٧Ί·͢ɻࣽ٧ΊͨॴͰҰࠞͥɺ࠶མ֖͠Λͯࣽ͠ो͕ͳ͘ͳΔ·Ͱ༷ࢠΛݟͳ͕Β ߋʹҐࣽ٧Ί͍͖ͯ·͢ɻࣽो͕ແ͘ͳͬͨΒՐΛࢭΊམ֖͠Λͨ͠··ؒɺৠΒ͠·̇͢ຯ ͕ߋʹછΈࠐΈ·͢ΐʂ͜͜େࣄʂͦͯ͠Ͱ̇͢
?Т? http://cookpad.com/recipe/1519259
ಡΈ͍͢ຊޠͷϙΠϯτ ͭͷஈམʹͭͷ༰ʹߜΔ μϥμϥͱ͍จষΛॻ͔ͳ͍ ൱ఆจΑΓߠఆจΛ͏ ͘ॻ͘
ಡΈखʹΘΔݴ༿ΛબͿ
ಡΈ͍͢ຊޠͷϙΠϯτ ͭͷஈམʹͭͷ༰ʹߜΔ ɹɹॲཧΛؔͱͯ͠Γग़͢୯Ұͷݪଇ μϥμϥͱ͍จষΛॻ͔ͳ͍ ɹɹؔ࠷େߦҎ ൱ఆจΑΓߠఆจΛ͏ ɹɹOPU)FBWZ6TFS
Ͱͳ͘JT)FBWZ6TFS ͘ॻ͘ ɹɹࡾ߲ԋࢉࢠΛ͏υɾϞϧΨϯͰׂ͢Δ ಡΈखʹΘΔݴ༿ΛબͿ ɹɹదͳม໊Λ͏
ಡΈ͍͢ιʔείʔυΛॻ͘ʹʁ 㾎 ॲཧΛׂ͢Δ 㾎 Θ͔Γ͍͢ม໊Λ͚ͭΔ 㾎 దͳίϝϯτΛ͚ͭΔ 㾎 ΠϯσϯτΛదʹͱΔ 㾎
൱ఆΑΓߠఆΛ͏ 㾎 ωετΛઙ͘͢Δ 㾎 ؆ܿʹॻ͘ 㾎 HPUPจΛΘͳ͍ 㾎 είʔϓͷൣғ࠷খݶʹ͢Δ 㾎 ୯Ұͷݪଇ 㾎 ίʔυΛখ͘͞อͭ 㾎 ࣮ͷҙਤΛ͢ 㾎 ໊લ͖Ҿ 㾎 Ҿͷͭ·Ͱ 㾎 ૬ޓࢀরΛආ͚Δ 㾎 ίʔϧόοΫࠈΛආ͚Δ 㾎 ΦϒδΣΫτͷґଘΛԼ͛Δ 㾎 ͳͲ
ࢀߟਤॻ
ಡΈ͍͢ιʔείʔυΛॻ͘ʹʁ 㾎 ॲཧΛׂ͢Δ 㾎 Θ͔Γ͍͢ม໊Λ͚ͭΔ 㾎 దͳίϝϯτΛ͚ͭΔ 㾎 ΠϯσϯτΛదʹͱΔ 㾎
൱ఆΑΓߠఆΛ͏ 㾎 ωετΛઙ͘͢Δ 㾎 ؆ܿʹॻ͘ 㾎 HPUPจΛΘͳ͍ 㾎 είʔϓͷൣғ࠷খݶʹ͢Δ 㾎 ୯Ұͷݪଇ 㾎 ίʔυΛখ͘͞อͭ 㾎 ࣮ͷҙਤΛ͢ 㾎 ໊લ͖Ҿ 㾎 Ҿͷͭ·Ͱ 㾎 ૬ޓࢀরΛආ͚Δ 㾎 ίʔϧόοΫࠈΛආ͚Δ 㾎 ΦϒδΣΫτͷґଘΛԼ͛Δ 㾎 ͳͲ
͔Γ͍͢ม໊Λ͚ͭΔ // Is it an array? -> isArray -> Yes
/ No (True / False) function isArray (arrayObject) {} // Does this array contain the item ? => Yes / No (True / False) function contains(array, item) {} // ಈࢺ + తޠ function fetchBooks () {} // ಈࢺΛબͿ => ӳޠྗ + ͕ࣝඞཁ function push() / append() / put() / add() / enqueue() / etc // ಈࢺ͡Όͳͯ͘໌֬ͳ߹ function api () {}
ಡΈ͍͢ιʔείʔυΛॻ͘ʹʁ 㾎 ॲཧΛׂ͢Δ 㾎 Θ͔Γ͍͢ม໊Λ͚ͭΔ 㾎 దͳίϝϯτΛ͚ͭΔ 㾎 ΠϯσϯτΛదʹͱΔ 㾎
൱ఆΑΓߠఆΛ͏ 㾎 ωετΛઙ͘͢Δ 㾎 ؆ܿʹॻ͘ 㾎 HPUPจΛΘͳ͍ 㾎 είʔϓͷൣғ࠷খݶʹ͢Δ 㾎 ୯Ұͷݪଇ 㾎 ίʔυΛখ͘͞อͭ 㾎 ࣮ͷҙਤΛ͢ 㾎 ໊લ͖Ҿ 㾎 Ҿͷͭ·Ͱ 㾎 ૬ޓࢀরΛආ͚Δ 㾎 ίʔϧόοΫࠈΛආ͚Δ 㾎 ΦϒδΣΫτͷґଘΛԼ͛Δ 㾎 ͳͲ
νʔϜͷΛଅ͢ https://flic.kr/p/7aFKv2
νʔϜͷΛଅ͢ ᶃΈΜͳͰϨϏϡʔ͢Δ w ଞͷਓͷίʔυΛݟֶͯͿ w ଞͷਓͷࢦఠΛݟֶͯͿ w ࢦఠͰ͖Δྔ࣭ͷมԽ͔ΒεΩϧΞοϓ͕࣮ײͰ͖Δ
https://flic.kr/p/aAvcFL Summary
·ͱΊ ᶃόά͕ͳ͍ w ༷௨Γʹಈ͖ɺΤϥʔέʔεͷߟྀ͋Δ w কདྷతʹόάʹͳΓͮΒ͍ ᶄಡΈ͍͢ w ຊޠͷจষͱҰॹ w
ͨ͘͞Μͷϊϋ͕ଘࡏ͢Δʢม໊ͷ͚ํͳͲʣ ᶅνʔϜͷΛଅ͢ w ΈΜͳͰϨϏϡʔ͢Δ
One More Step
ใॲཧٕज़ऀࢼݧc*1"
$ISPNFΞοϓσʔτc$ISPNJVN#MPH
σβΠϯύλʔϯc5&$)4$03&
͏ͭϓϩάϥϛϯάݴޠΛ
Thank you http://www.yoheim.net @yoheiMune https://flic.kr/p/mzmQK2