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
Fast Forward Javascript
Search
Sho Kusano
October 16, 2012
Programming
1
590
Fast Forward Javascript
立ち止まってる暇なんてない。 CoffeeScript の紹介です。
Sho Kusano
October 16, 2012
Tweet
Share
More Decks by Sho Kusano
See All by Sho Kusano
ISUCON 反省会
rosylilly
0
170
ISUCON 夏祭り 2023 ハンズオン資料
rosylilly
1
5.8k
今日から始めるリアルタイム配信の裏側
rosylilly
10
7.3k
ISUCON12 事前講習
rosylilly
7
12k
BURST #0
rosylilly
1
170
ISUCON 11 Prior
rosylilly
10
17k
ISUCON 夏期講習 2020
rosylilly
6
9.7k
真剣.js / shinken-js
rosylilly
1
3.7k
Sustainable Operation
rosylilly
2
3.3k
Other Decks in Programming
See All in Programming
データ利用者が最速で価値を評価できるDataOpsを目指して / Towards DataOps that Enables Analysts to Deliver Value Rapidly
civitaspo
3
480
わかりやすい正解を捨てて、コトに向き合う - スクラムフェス金沢2024 スポンサーセッション
yusukekokubo
0
350
Submission with Numerai Compute using GCP Batch
regonn
0
220
Flutter gRPC - 박제창 @I/O Extended 2024 인천/송도
itsmedreamwalker
0
110
[Developers Boost 2024] 4年半の現場経験から見えてきた、フロントエンドエンジニアに必要なスキル
sakamuuy
0
350
企業向け生成AIアプリの 開発から得られた知見
takaakikakei
0
350
Rustのweb開発を助ける 便利なツール紹介
yuki0418
1
260
CSC307 Lecture 12
javiergs
PRO
0
250
CSC307 Lecture 13
javiergs
PRO
0
150
GitHub Projectsを自動化するGitHub CLIテクニック / Automate GitHub Projects with GitHub CLI
tasshi
0
200
AWS Summit Japan 2024, AWS Game Day 振り返り - NIFTY Tech Talk #20
niftycorp
PRO
2
110
図面中の風船番号の読み取りについて。Amazon RekognitionとClaude 3.5 Sonnetの画像認識の検証
hideg
0
190
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
399
65k
No one is an island. Learnings from fostering a developers community.
thoeni
18
2.8k
Music & Morning Musume
bryan
43
5.9k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
22
8.7k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
36
9.1k
Typedesign – Prime Four
hannesfritz
37
2.2k
Fontdeck: Realign not Redesign
paulrobertlloyd
79
5.1k
Building Applications with DynamoDB
mza
89
5.9k
A Tale of Four Properties
chriscoyier
155
22k
Building an army of robots
kneath
301
42k
Debugging Ruby Performance
tmm1
72
12k
Documentation Writing (for coders)
carmenintech
63
4.2k
Transcript
Forward Fast Javascript Sho Kusano / rosylilly
Profile Sho Kusano rosylilly Facebook: sho.kusano Twitter: rosylilly Mail:
[email protected]
Profile Works Dwango/Qteras Model (স) 10/28(Fri) Numero Tokyo
―― Too Many Works ࣄࣺͯΔ΄Ͳ͋Δ
Q. Javascript͕؆୯ͩͱࢥ͏ํ ஏ͔͕ͣ͠ΒͣڍखΛ͓ئ͍͠·͢
A. ʹͱ͍ͬͯ͠ Ͱ͖ΔݶΓॻ͖ͨ͘ͳ͍
ָ͕ग़དྷΕͦΕ͕Ұ൪
ָͯ͠ ͓͕ۚ ཉ͍͠
CoffeeScript is a little language that compiles into JavaScript. http://coffeescript.org/
Fast Forward Javascript ߴʹ લਐΉͨΊͷ CoffeeScript
Javascript ʹ᠘͕ଟ͍ this scope, Prototypical Object, Object forEach
ʰલਐ͢Δ͜ͱʱʹूதग़དྷͳ͍
Let’s try CoffeeScript!
Example Cases
Example Case: This binding var object = { name: 'obj',
func: function(){ console.log(this.name); } } object.func(); // → obj var f = object.func; f(); // → undefined var other = {name: 'other', func: f}; other.func(); // → other
Example Case: This Binding class Example name: 'obj' func: ()=>
console.log @name object = new Example object.func() # → obj f = object.func f() # → obj other = { name: 'other' func: f } other.func() # → obj
Example Case: Prototypical Object var Abstruct = function() { this.prop
= 'property'; } Abstruct.prototype.func = function(){}; var Class = function() { } Class.prototype = {}; for(var method in Abstruct.prototype) { Class.prototype[method] = Abstruct.prototype[method]; }
Example Case: Prototypical Object class Abstruct prop: 'property' func: ()->
class Class extends Abstruct
Example Case: Object forEach var object = { a: 1,
b: 2, c: 3 } for(var key in object) { if(object.hasOwnProperty(key)) console.log(object[key]); }
Example Case: Object forEach object = { a: 1 b:
2, c: 3 } for key, val of object console.log val
Many Features! Destructuring Assignment, Function binding, Embedded JavaScript, Switch/When/Else, Try/Catch/Finally,
Chained Comparisons, String Interpolation, Block Strings, and Block Comments, Block Regular Expressions, Cake, and Cakefiles, "text/coffeescript" Script Tags
Don’t worry!!
֮͑Δͷ͕େมͦ͏... Javascript Ͱۤ͠Ή࣌ؒͱ CoffeeScript Λ֮͑Δ࣌ؒ ͲͪΒ͕͍͔ ↓
͏Ұݸݴޠ֮͑Δͷͪΐͬͱ…… ͋͘·Ͱ JS ͷγϯλοΫεγϡΨʔͱ ଊ͑ͯΑ͍ (JSX, HeXe ͳͲͱൺͯ) ↓
ಋೖ͕େมͦ͏…… Rails3 ͕ WebFront ͳΒࠓ͔Β͑·͢ɻ ͦͷଞɺ Coffee ͔Β JS ʹมͰ͖Δ͠
ϒϥβ্Ͱ Coffee ಈ͔͢Έ͋Δ ↓
ϝϯόʔͷઆಘ͕…… ͕ࣗࣾͰΤϰΝϯδΣϦετʹͳΔνϟϯεʂ ↓
Thank you for listening. rosylilly Fin Fast Forward Javascript