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.1k
How to create a service, How to google !
yoheimune
0
270
Machine Learning Basic and Python
yoheimune
1
460
Python Scraping and Web Apps for G's ACADEMY TOKYO
yoheimune
0
220
DevelopWorkflow and Solving Problems
yoheimune
0
410
Git and Github for Beginners
yoheimune
1
270
Data Science BOOTCAMP Practices - Recommendation
yoheimune
0
180
Data Science BOOTCAMP Practices
yoheimune
0
340
Machine Learning with Python
yoheimune
0
310
Other Decks in Technology
See All in Technology
Microsoft Fabric OneLake の実体について
ryomaru0825
0
190
フロントエンド メタフレームワーク 選定の際に考えたこと
yuppeeng
0
590
データ活用促進のためのデータ分析基盤の進化
takumakouno
2
160
[JAWS-UG金沢支部×コンテナ支部合同企画]コンテナとは何か
furuton
3
340
10分でわかるfreeeのQA
freee
1
3.4k
Railsで4GBのデカ動画ファイルのアップロードと配信、どう実現する?
asflash8
1
190
Platform Engineering ことはじめ
oracle4engineer
PRO
8
790
形式手法の 10 メートル手前 #kernelvm / Kernel VM Study Hokuriku Part 7
ytaka23
5
740
「 SharePoint 難しい」ってよく聞くけど、そんなに言うなら8歳の息子に試してもらった
taichinakamura
2
790
FOSS4G 2024 Japan コアデイ 一般発表25 PythonでPLATEAUのデータを手軽に扱ってみる
ra0kley
1
130
オーティファイ会社紹介資料 / Autify Company Deck
autifyhq
9
120k
OCI Data Integration技術情報 / ocidi_technical_jp
oracle4engineer
PRO
1
2.6k
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Statistics for Hackers
jakevdp
796
220k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Automating Front-end Workflow
addyosmani
1366
200k
It's Worth the Effort
3n
183
27k
Side Projects
sachag
452
42k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
360
How to train your dragon (web standard)
notwaldorf
88
5.7k
Typedesign – Prime Four
hannesfritz
40
2.4k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
505
140k
Building Your Own Lightsaber
phodgson
102
6.1k
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