SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Andere mochten auch

карта мышления для вики
карта мышления для викикарта мышления для вики
карта мышления для викиKonshina
 
Visiones sobre el aprendizaje
Visiones sobre el aprendizajeVisiones sobre el aprendizaje
Visiones sobre el aprendizajeCamilo Pulido
 
Virror Product Showcase
Virror Product ShowcaseVirror Product Showcase
Virror Product ShowcaseOmar Mekky
 
кращі вчителі школи
кращі вчителі школикращі вчителі школи
кращі вчителі школиmax_iwan
 
Datafying Bitcoins
Datafying BitcoinsDatafying Bitcoins
Datafying BitcoinsTariq Ahmad
 
امکان‌سنجی طراحی و ساخت سخت‌افزار شبیه‌ساز کنترل فوران چاه و نوشتن نرم افزار آن
امکان‌سنجی طراحی و ساخت سخت‌افزار شبیه‌ساز کنترل فوران چاه و نوشتن نرم افزار آنامکان‌سنجی طراحی و ساخت سخت‌افزار شبیه‌ساز کنترل فوران چاه و نوشتن نرم افزار آن
امکان‌سنجی طراحی و ساخت سخت‌افزار شبیه‌ساز کنترل فوران چاه و نوشتن نرم افزار آنTechnical University of Denamrk
 
Skies miltonia location map
Skies miltonia location mapSkies miltonia location map
Skies miltonia location mapHenry Loh
 
Bartley residences photos
Bartley residences photosBartley residences photos
Bartley residences photosHenry Loh
 
(cement permeability test) آزمایش تراوایی سیمان
(cement permeability test) آزمایش تراوایی سیمان(cement permeability test) آزمایش تراوایی سیمان
(cement permeability test) آزمایش تراوایی سیمانTechnical University of Denamrk
 
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
 

Andere mochten auch (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
 

Ähnlich wie Coffeescript - take a sip of code

Coffee scriptisforclosers nonotes
Coffee scriptisforclosers nonotesCoffee scriptisforclosers nonotes
Coffee scriptisforclosers nonotesBrandon Satrom
 
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 CoffeeScriptEddie 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 JasminePaulo Ragonha
 
CoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-TuesdayCoffeeScript-Ruby-Tuesday
CoffeeScript-Ruby-TuesdayEddie Kao
 
CoffeeScript, An Introduction for Nodejs developers
CoffeeScript, An Introduction for Nodejs developersCoffeeScript, An Introduction for Nodejs developers
CoffeeScript, An Introduction for Nodejs developersMehdi Valikhani
 
Real life-coffeescript
Real life-coffeescriptReal life-coffeescript
Real life-coffeescriptDavid Furber
 
Coffee script final
Coffee script finalCoffee script final
Coffee script finalpriyankazope
 
Damn Fine CoffeeScript
Damn Fine CoffeeScriptDamn Fine CoffeeScript
Damn Fine CoffeeScriptniklal
 
Introduction to CoffeeScript
Introduction to CoffeeScriptIntroduction to CoffeeScript
Introduction to CoffeeScriptStalin Thangaraj
 
CoffeeScript
CoffeeScriptCoffeeScript
CoffeeScriptNone
 
CoffeeScript & Jasmine - MadJS February 2012
CoffeeScript & Jasmine - MadJS February 2012CoffeeScript & Jasmine - MadJS February 2012
CoffeeScript & Jasmine - MadJS February 2012Matt Gauger
 
Coffeescript - what's good
Coffeescript - what's goodCoffeescript - what's good
Coffeescript - what's goodJeongHun Byeon
 
Object Oriented Programming In JavaScript
Object Oriented Programming In JavaScriptObject Oriented Programming In JavaScript
Object Oriented Programming In JavaScriptForziatech
 
CoffeeScript Design Patterns
CoffeeScript Design PatternsCoffeeScript Design Patterns
CoffeeScript Design PatternsTrevorBurnham
 

Ähnlich wie 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
 

Mehr von Dimitris Tsironis

Mehr von 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
 

Kürzlich hochgeladen

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Kürzlich hochgeladen (20)

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 

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.)