coffeescript in 5mins
DESCRIPTION
TRANSCRIPT
![Page 1: CoffeeScript in 5mins](https://reader034.vdocuments.net/reader034/viewer/2022051323/547ce7b65906b54d378b45ea/html5/thumbnails/1.jpg)
CoffeeScript in 5mins@mackato - 2011.09.14 #izakaya.js
11年9月15日木曜日
![Page 2: CoffeeScript in 5mins](https://reader034.vdocuments.net/reader034/viewer/2022051323/547ce7b65906b54d378b45ea/html5/thumbnails/2.jpg)
“CoffeeScript is a little languagethat compiles into JavaScript.”
11年9月15日木曜日
![Page 3: CoffeeScript in 5mins](https://reader034.vdocuments.net/reader034/viewer/2022051323/547ce7b65906b54d378b45ea/html5/thumbnails/3.jpg)
Pros
less codecompile-time code check
compiles into pure JavaScript
11年9月15日木曜日
![Page 4: CoffeeScript in 5mins](https://reader034.vdocuments.net/reader034/viewer/2022051323/547ce7b65906b54d378b45ea/html5/thumbnails/4.jpg)
Cons
require compile process
little strange syntax
debugging is too hard, yet.
11年9月15日木曜日
![Page 5: CoffeeScript in 5mins](https://reader034.vdocuments.net/reader034/viewer/2022051323/547ce7b65906b54d378b45ea/html5/thumbnails/5.jpg)
Use CaseRails 3.1
11年9月15日木曜日
![Page 6: CoffeeScript in 5mins](https://reader034.vdocuments.net/reader034/viewer/2022051323/547ce7b65906b54d378b45ea/html5/thumbnails/6.jpg)
Use CaseAny other JavaScript Frameworks
11年9月15日木曜日
![Page 7: CoffeeScript in 5mins](https://reader034.vdocuments.net/reader034/viewer/2022051323/547ce7b65906b54d378b45ea/html5/thumbnails/7.jpg)
JS to CoffeeScript$(document).ready(function() { init(); some(); $("a.link").click(function() { $(this).fadeOut("slow", function () { $(this).remove(); }); });});
11年9月15日木曜日
![Page 8: CoffeeScript in 5mins](https://reader034.vdocuments.net/reader034/viewer/2022051323/547ce7b65906b54d378b45ea/html5/thumbnails/8.jpg)
JS to CoffeeScript$(document).ready(function() { init() some() $("a.link").click(function() { $(this).fadeOut("slow", function () { $(this).remove() }) })})
11年9月15日木曜日
![Page 9: CoffeeScript in 5mins](https://reader034.vdocuments.net/reader034/viewer/2022051323/547ce7b65906b54d378b45ea/html5/thumbnails/9.jpg)
JS to CoffeeScript$(document).ready function() init() some() $("a.link").click function() $(this).fadeOut "slow", function () $(this).remove()
11年9月15日木曜日
![Page 10: CoffeeScript in 5mins](https://reader034.vdocuments.net/reader034/viewer/2022051323/547ce7b65906b54d378b45ea/html5/thumbnails/10.jpg)
JS to CoffeeScript$(document).ready -> init() some() $("a.link").click -> $(this).fadeOut "slow", -> $(this).remove()
11年9月15日木曜日
![Page 11: CoffeeScript in 5mins](https://reader034.vdocuments.net/reader034/viewer/2022051323/547ce7b65906b54d378b45ea/html5/thumbnails/11.jpg)
JavaScript build is necessary without CoffeeScript
concatenate
<script src="/javascripts/jquery.js"></script> <script src="/javascripts/jquery.min.js"></script> <script src="/javascripts/application.js"></script>
<script src="/javascripts/all.js"></script>
11年9月15日木曜日
![Page 12: CoffeeScript in 5mins](https://reader034.vdocuments.net/reader034/viewer/2022051323/547ce7b65906b54d378b45ea/html5/thumbnails/12.jpg)
JavaScript build is necessary without CoffeeScript
minify(function( window, undefined ) { var document = window.document, navigator = window.navigator, location = window.location;
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!cj[a]){var b=f("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),c.body.appen11年9月15日木曜日
![Page 13: CoffeeScript in 5mins](https://reader034.vdocuments.net/reader034/viewer/2022051323/547ce7b65906b54d378b45ea/html5/thumbnails/13.jpg)
JavaScript build is necessary without CoffeeScript
concatenate minify
js
js
js
js js
11年9月15日木曜日
![Page 14: CoffeeScript in 5mins](https://reader034.vdocuments.net/reader034/viewer/2022051323/547ce7b65906b54d378b45ea/html5/thumbnails/14.jpg)
JavaScript build is necessary without CoffeeScript
concatenate minify
js
js
js
coffee
coffee
coffee
js js
compile
11年9月15日木曜日
![Page 15: CoffeeScript in 5mins](https://reader034.vdocuments.net/reader034/viewer/2022051323/547ce7b65906b54d378b45ea/html5/thumbnails/15.jpg)
Cons
require compile process # not cons
little strange syntax
debugging is too hard, yet.
11年9月15日木曜日