SlideShare una empresa de Scribd logo
1 de 21
Descargar para leer sin conexión
CoffeeScript
  Unfancy JavaScript
Dimitris
Tsironis
CEO & Founder at Geembo

UI designer & huge geek,
who loves good design and
french fries, as much as
good indentation in a
stylesheet.

@tsironakos
Jeremy
Ashkenas
Interactive News at the
NYTimes /
DocumentCloud •
Creator of CoffeeScript
+ Backbone.js • Code is
Literature
CoffeeScript is a little language
 that compiles into Javascript
It’s just Javascript!
Code is poetry...
A beautiful programming language


  Least amount of code to get the job done

  Readable and understandable

  Easy to maintain

  well, should have elegant and beautiful form
Let’s see some code!
Variables
 message = “Ready for some coffee?”
                                               CoffeeScript
 alert(message)

 var message;
 message = “Ready for some coffee?”;           JavaScript
 alert(message);



Functions
 coffee = ->
                                               CoffeeScript
   confirm “Ready for some coffee?”

 var coffee = function() {
   return confirm(“Ready for some coffee?”);   JavaScript
 }
Example
 coffee = ->
   answer = confirm “Ready for some coffee?”     CoffeeScript
  “Your answer is ” + answer

or “Your answer is #{answer}”


 var coffee;
 coffee = function() {
   var answer;
                                                 JavaScript
   answer = confirm(“Ready for some coffee?”);
   return “Your answer is ” + answer;
 }
Function Parameters
 coffee = (message) ->
   answer = confirm message             CoffeeScript
  “Your answer is #{answer}”




 var coffee;
 coffee = function(message) {
   var answer;
                                        JavaScript
   answer = confirm(message);
   return “Your answer is “ + answer;
 }
Optional Parameters
 coffee = (message = “Ready for some coffee”) ->
   answer = confirm message                        CoffeeScript
   “Your answer is #{answer}”




 var coffee;
 coffee = function(message) {
   var answer;
                                                   JavaScript
   if (message == null) {
     message = “Ready for some coffee?”;
   }
   answer = confirm(message);
   return “Your answer is “ + answer;
 }
Applied jQuery
  $ ->
    changeTab = (e) ->
       e.preventDefault()
       $(“#tabs li a.active”).removeClass “active”   CoffeeScript
       $(@).addClass “active”

    $(“#tabs ul li a”).click changeTab



jQuery(function($) {
  function changeTab(e) {
    e.preventDefault();
    $(“#tabs li a.active”).removeClass(“active”);      jQuery
    $(this).addClass(“active”);
  }
  $(“#tabs ul li a”).click(changeTab);
});
You get the idea
hubot, make me some coffee please!
Hubot is your company's robot.
Install him in your company to dramatically
  improve and reduce employee efficiency.
What he/she does

Lives in your chat (Campfire, GTalk, Hipchat etc.)

Deploys your code

Connect to your issues, commits etc.

Finds funny cat gifs

Integrates with almost every service on Earth

Manages the playlist in your office

everything you could imagine!
Written in CoffeeScript
 (and some Perl and Shell)
we have our own hubot

 Meet Geembot!
Open source & expandable
 (original written by Github Inc.)
Thanks!
Follow me

@geembohq

@tsironakos

Más contenido relacionado

Destacado

карта мышления для вики
карта мышления для викикарта мышления для вики
карта мышления для вики
Konshina
 
кращі вчителі школи
кращі вчителі школикращі вчителі школи
кращі вчителі школи
max_iwan
 
Skies miltonia location map
Skies miltonia location mapSkies miltonia location map
Skies miltonia location map
Henry Loh
 
Bartley residences photos
Bartley residences photosBartley residences photos
Bartley residences photos
Henry Loh
 
2 5 estensione_vita_materiali_vezzoli_polimi_12.13 (9)
2 5 estensione_vita_materiali_vezzoli_polimi_12.13 (9)2 5 estensione_vita_materiali_vezzoli_polimi_12.13 (9)
2 5 estensione_vita_materiali_vezzoli_polimi_12.13 (9)
elisa_bacchetti
 

Destacado (20)

Great Company Concepto
Great Company ConceptoGreat Company Concepto
Great Company Concepto
 
El eros electronico
El eros electronicoEl eros electronico
El eros electronico
 
карта мышления для вики
карта мышления для викикарта мышления для вики
карта мышления для вики
 
Visiones sobre el aprendizaje
Visiones sobre el aprendizajeVisiones sobre el aprendizaje
Visiones sobre el aprendizaje
 
Virror Product Showcase
Virror Product ShowcaseVirror Product Showcase
Virror Product Showcase
 
Large hadron collider
Large hadron colliderLarge hadron collider
Large hadron collider
 
مته های حفاری
مته های حفاریمته های حفاری
مته های حفاری
 
кращі вчителі школи
кращі вчителі школикращі вчителі школи
кращі вчителі школи
 
Tower a
Tower aTower a
Tower a
 
Pd rational
Pd rationalPd rational
Pd rational
 
Datafying Bitcoins
Datafying BitcoinsDatafying Bitcoins
Datafying Bitcoins
 
امکان‌سنجی طراحی و ساخت سخت‌افزار شبیه‌ساز کنترل فوران چاه و نوشتن نرم افزار آن
امکان‌سنجی طراحی و ساخت سخت‌افزار شبیه‌ساز کنترل فوران چاه و نوشتن نرم افزار آنامکان‌سنجی طراحی و ساخت سخت‌افزار شبیه‌ساز کنترل فوران چاه و نوشتن نرم افزار آن
امکان‌سنجی طراحی و ساخت سخت‌افزار شبیه‌ساز کنترل فوران چاه و نوشتن نرم افزار آن
 
Pequena borboleta slid
Pequena borboleta slidPequena borboleta slid
Pequena borboleta slid
 
Skies miltonia location map
Skies miltonia location mapSkies miltonia location map
Skies miltonia location map
 
Bartley residences photos
Bartley residences photosBartley residences photos
Bartley residences photos
 
(cement permeability test) آزمایش تراوایی سیمان
(cement permeability test) آزمایش تراوایی سیمان(cement permeability test) آزمایش تراوایی سیمان
(cement permeability test) آزمایش تراوایی سیمان
 
Xii promoción
Xii promociónXii promoción
Xii promoción
 
De lopende band
De lopende bandDe lopende band
De lopende band
 
2 5 estensione_vita_materiali_vezzoli_polimi_12.13 (9)
2 5 estensione_vita_materiali_vezzoli_polimi_12.13 (9)2 5 estensione_vita_materiali_vezzoli_polimi_12.13 (9)
2 5 estensione_vita_materiali_vezzoli_polimi_12.13 (9)
 
Álvarez Méndez
Álvarez  MéndezÁlvarez  Méndez
Álvarez Méndez
 

Similar a Coffeescript - take a sip of code

An Intoduction to Coffeescript (Turkish)
An Intoduction to Coffeescript (Turkish)An Intoduction to Coffeescript (Turkish)
An Intoduction to Coffeescript (Turkish)
Seyfeddin Bassarac
 
Happy Programming with CoffeeScript
Happy Programming with CoffeeScriptHappy Programming with CoffeeScript
Happy Programming with CoffeeScript
Eddie Kao
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Paulo Ragonha
 
CoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-TuesdayCoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-Tuesday
Eddie Kao
 
CoffeeScript, An Introduction for Nodejs developers
CoffeeScript, An Introduction for Nodejs developersCoffeeScript, An Introduction for Nodejs developers
CoffeeScript, An Introduction for Nodejs developers
Mehdi Valikhani
 
Coffee script final
Coffee script finalCoffee script final
Coffee script final
priyankazope
 
CoffeeScript
CoffeeScriptCoffeeScript
CoffeeScript
None
 
CoffeeScript & Jasmine - MadJS February 2012
CoffeeScript & Jasmine - MadJS February 2012CoffeeScript & Jasmine - MadJS February 2012
CoffeeScript & Jasmine - MadJS February 2012
Matt Gauger
 
Coffeescript - what's good
Coffeescript - what's goodCoffeescript - what's good
Coffeescript - what's good
JeongHun Byeon
 

Similar a Coffeescript - take a sip of code (20)

test
testtest
test
 
Coffeescript slides
Coffeescript slidesCoffeescript slides
Coffeescript slides
 
Coffee scriptisforclosers nonotes
Coffee scriptisforclosers nonotesCoffee scriptisforclosers nonotes
Coffee scriptisforclosers nonotes
 
Quick coffeescript
Quick coffeescriptQuick coffeescript
Quick coffeescript
 
An Intoduction to Coffeescript (Turkish)
An Intoduction to Coffeescript (Turkish)An Intoduction to Coffeescript (Turkish)
An Intoduction to Coffeescript (Turkish)
 
kRouter
kRouterkRouter
kRouter
 
Happy Programming with CoffeeScript
Happy Programming with CoffeeScriptHappy Programming with CoffeeScript
Happy Programming with CoffeeScript
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
 
CoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-TuesdayCoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-Tuesday
 
CoffeeScript, An Introduction for Nodejs developers
CoffeeScript, An Introduction for Nodejs developersCoffeeScript, An Introduction for Nodejs developers
CoffeeScript, An Introduction for Nodejs developers
 
Real life-coffeescript
Real life-coffeescriptReal life-coffeescript
Real life-coffeescript
 
Coffee script final
Coffee script finalCoffee script final
Coffee script final
 
Damn Fine CoffeeScript
Damn Fine CoffeeScriptDamn Fine CoffeeScript
Damn Fine CoffeeScript
 
Introduction to CoffeeScript
Introduction to CoffeeScriptIntroduction to CoffeeScript
Introduction to CoffeeScript
 
Smooth CoffeeScript
Smooth CoffeeScriptSmooth CoffeeScript
Smooth CoffeeScript
 
CoffeeScript
CoffeeScriptCoffeeScript
CoffeeScript
 
CoffeeScript & Jasmine - MadJS February 2012
CoffeeScript & Jasmine - MadJS February 2012CoffeeScript & Jasmine - MadJS February 2012
CoffeeScript & Jasmine - MadJS February 2012
 
Coffeescript - what's good
Coffeescript - what's goodCoffeescript - what's good
Coffeescript - what's good
 
Object Oriented Programming In JavaScript
Object Oriented Programming In JavaScriptObject Oriented Programming In JavaScript
Object Oriented Programming In JavaScript
 
CoffeeScript Design Patterns
CoffeeScript Design PatternsCoffeeScript Design Patterns
CoffeeScript Design Patterns
 

Más de Dimitris Tsironis (7)

Automating Front-End Workflow
Automating Front-End WorkflowAutomating Front-End Workflow
Automating Front-End Workflow
 
Modern Webapps
Modern WebappsModern Webapps
Modern Webapps
 
Git 201
Git 201Git 201
Git 201
 
Git 101
Git 101Git 101
Git 101
 
HTML+CSS: how to get started
HTML+CSS: how to get startedHTML+CSS: how to get started
HTML+CSS: how to get started
 
Capistrano for non-rubyist
Capistrano for non-rubyistCapistrano for non-rubyist
Capistrano for non-rubyist
 
Coffeescript unfancy javascript
Coffeescript unfancy javascriptCoffeescript unfancy javascript
Coffeescript unfancy javascript
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Coffeescript - take a sip of code

  • 1. CoffeeScript Unfancy JavaScript
  • 2. Dimitris Tsironis CEO & Founder at Geembo UI designer & huge geek, who loves good design and french fries, as much as good indentation in a stylesheet. @tsironakos
  • 3. Jeremy Ashkenas Interactive News at the NYTimes / DocumentCloud • Creator of CoffeeScript + Backbone.js • Code is Literature
  • 4. CoffeeScript is a little language that compiles into Javascript
  • 7. A beautiful programming language Least amount of code to get the job done Readable and understandable Easy to maintain well, should have elegant and beautiful form
  • 9. Variables message = “Ready for some coffee?” CoffeeScript alert(message) var message; message = “Ready for some coffee?”; JavaScript alert(message); Functions coffee = -> CoffeeScript confirm “Ready for some coffee?” var coffee = function() { return confirm(“Ready for some coffee?”); JavaScript }
  • 10. Example coffee = -> answer = confirm “Ready for some coffee?” CoffeeScript “Your answer is ” + answer or “Your answer is #{answer}” var coffee; coffee = function() { var answer; JavaScript answer = confirm(“Ready for some coffee?”); return “Your answer is ” + answer; }
  • 11. Function Parameters coffee = (message) -> answer = confirm message CoffeeScript “Your answer is #{answer}” var coffee; coffee = function(message) { var answer; JavaScript answer = confirm(message); return “Your answer is “ + answer; }
  • 12. Optional Parameters coffee = (message = “Ready for some coffee”) -> answer = confirm message CoffeeScript “Your answer is #{answer}” var coffee; coffee = function(message) { var answer; JavaScript if (message == null) { message = “Ready for some coffee?”; } answer = confirm(message); return “Your answer is “ + answer; }
  • 13. Applied jQuery $ -> changeTab = (e) -> e.preventDefault() $(“#tabs li a.active”).removeClass “active” CoffeeScript $(@).addClass “active” $(“#tabs ul li a”).click changeTab jQuery(function($) { function changeTab(e) { e.preventDefault(); $(“#tabs li a.active”).removeClass(“active”); jQuery $(this).addClass(“active”); } $(“#tabs ul li a”).click(changeTab); });
  • 14. You get the idea
  • 15. hubot, make me some coffee please!
  • 16. Hubot is your company's robot. Install him in your company to dramatically improve and reduce employee efficiency.
  • 17. What he/she does Lives in your chat (Campfire, GTalk, Hipchat etc.) Deploys your code Connect to your issues, commits etc. Finds funny cat gifs Integrates with almost every service on Earth Manages the playlist in your office everything you could imagine!
  • 18. Written in CoffeeScript (and some Perl and Shell)
  • 19. we have our own hubot Meet Geembot!
  • 20. Open source & expandable (original written by Github Inc.)