SlideShare a Scribd company logo
Throw-down
Node.pgh Meetup
Nicholas McClay
UX Designer & Developer




@nickmcclay
There are a lot of opinions
   about CoffeeScript
Coffee script throwdown
“You can take my JavaScript when you pry it from
“You can take my JavaScript when you pry it from
             my cold dead hands!”
              my cold dead hands!”
Let’s take a deep breath
and try and have an open
       mind here...
What is                                                   ?


 CoffeeScript is a small language that compiles into JavaScript

 Usable for client-side and server-side applications (Node.js)

 Has an opinionated alternative syntax for building JavaScript
 applications
What is a Trans-compiling
       Language?
       Language?

              Compile


    .coffee             .js
Pick your problem

“I want a better JavaScript!”

                                    “I want functional
                                     programming!”

         “I want strict typing!”
                                   Objective-J
                                   “I want Objective-C!”


  “I work at google!”
                                            http://altjs.org/
Why should I care about
    CoffeeScript?
Question: How many of
 you use CoffeeScript?
Question: How many of
you have used a module
written in CoffeeScript?
Isaac Schleuter (maintainer of Node.js / NPM)
        Node’s top contributors
            TJ Holowaychuk (express, Jade, Mocha)

       No   Mikeal Rogers (Request)
       No
       No   James Haliday "substack" (Browserify, dnode, Optimist)
       No   Guillermo Rauch (Socket.IO)
       No
       No   Aaron Heckmann (Mongoose)
       No
       No   Nathan Rajich "Too Tall Nate" (node-gyp)
       No
            Marak Squires (Hook.io, pdf.js, color.js)
       No
            Felix Geisendörfer
http://procbits.com/2012/05/18/why-do-all-the-great-node-js-develope
            Tim Caswell (NVM)
And Yet...
Larger Node Community


        Yes
 Currently ranked 4th as the
 most depended upon module in
           NPM


  More than Express! (just
         barely)
Getting Started with
    CoffeeScript
Learning CoffeeScript

  http://coffeescript.codeschool.com/




http://arcturo.github.com/library/coffeescript/
Give it a try!
                   Install
sudo npm install -g coffee-script

         Start the CoffeeScript REPL
coffee

  Compile a .coffee file into equivalent .js
coffee --compile <path to js file>


Compile .coffee file when source changes
coffee --watch --compile <path to js file>


   Compile and start file with Node.js
coffee --nodejs <path to node.js file>
Basic Node Connect Server
CoffeeScript Principles

       1 - Clarity

       2 - Uniformity

       3 - Ease of
       Translation
       to JavaScript
Clarity
Significant White Space




   1/2 to 1/3 compared to pure JavaScript
Keywords
Default Arguments
((Parentheticals) Optional)
Uniformity




      Everything is an expression!
Language Enhancements
 Array Comprehension, Classes, and much more...
Fix some JavaScript pitfalls
    http://bonsaiden.github.com/JavaScript-Garden/




  this, null and undefined, prototype wackiness, goodbye
  default global!
Ease of Translation to Javascript



 The golden rule of CoffeeScript is: "It's just JavaScript"

 The compiled output is readable and pretty-printed,
 passes through JavaScript Lint without warnings
Learning Pains
CoffeeScript Misunderstandings


 CoffeeScript is NOT a superset of JavaScript

 CoffeeScript is compiled NOT interpreted at runtime

 You must SHOULD learn JavaScript before using
 CoffeeScript

 Compiled CoffeeScript CAN be slower than pure JavaScript,
 but really this usually isn’t an issue.
Mind the gap...
Mind the gap...
Punctuation Counts...
Punctuation Counts...



   OR
CoffeeScript Pain Points?


Requires a compilation step (use file watcher or --watch)

Community is a subset of larger JavaScript community

Debugging...
CoffeeScript Debugging
       Strategies
Mental Map Debugging




 “You wanted to write it in CoffeeScript, you figure it out.”
Source Map Debugging

      .js   .map   .coffee
WebStorm + CoffeeScript




  http://www.youtube.com/watch?v=Sl1Uk3zT5Fg
Issue in WebStorm 6
          CoffeeScript gives you :



             WebStorm wants :

    Manually adjusting the source map
       reference makes it work...



http://youtrack.jetbrains.com/issue/WEB-7091
Even products that advertise CoffeeScript
       support can have issues...
Add “await” and “defer” keywords for async
Thanks!


@nickmcclay

More Related Content

PPTX
CoffeeScript the Awesome
PDF
Hello npm
PPTX
Apache Mesos Distributed Computing Talk
PDF
プログラマ三大美徳を実現するデプロイフローを目指して
PPTX
CSS Regression Tests
PPTX
Simplicity - develop modern web apps with tiny frameworks and tools
PPTX
Dial up your flow
PDF
Cucumber.js: Cuke up your JavaScript!
CoffeeScript the Awesome
Hello npm
Apache Mesos Distributed Computing Talk
プログラマ三大美徳を実現するデプロイフローを目指して
CSS Regression Tests
Simplicity - develop modern web apps with tiny frameworks and tools
Dial up your flow
Cucumber.js: Cuke up your JavaScript!

What's hot (20)

PDF
The Once And Future Script Loader (v3)
PDF
Quo vadis, JavaScript? Devday.pl keynote
PDF
Js Automation. npm scripts & Gulp
PPT
Testing Storm components with Groovy and Spock
PDF
[5분 따라하기] 비주얼 스튜디오 C++에서 JSON 파서 설치하기
PPTX
React native
PPTX
Improving Workflows With Grunt.js - Big D Design 2014 - Dallas Texas
PPTX
Untangling spring week10
PPTX
Integrating grunt and bower with maven
KEY
Scrabbly GTUG presentation
PPTX
Java script introduction
PDF
Groovy - Why and Where?
PDF
5 Quick JavaScript Performance Improvement Tips
PDF
JSFoo-2017 Takeaways
PPT
High performance java script why everything youve been taught is wrong
PDF
Choosing the best JavaScript framework/library/toolkit
PPTX
Node.js Getting Started &amd Best Practices
PPTX
Untangling - fall2017 - week 7
PDF
Gatsby vs. Next.js
PPTX
Untangling - fall2017 - week6
The Once And Future Script Loader (v3)
Quo vadis, JavaScript? Devday.pl keynote
Js Automation. npm scripts & Gulp
Testing Storm components with Groovy and Spock
[5분 따라하기] 비주얼 스튜디오 C++에서 JSON 파서 설치하기
React native
Improving Workflows With Grunt.js - Big D Design 2014 - Dallas Texas
Untangling spring week10
Integrating grunt and bower with maven
Scrabbly GTUG presentation
Java script introduction
Groovy - Why and Where?
5 Quick JavaScript Performance Improvement Tips
JSFoo-2017 Takeaways
High performance java script why everything youve been taught is wrong
Choosing the best JavaScript framework/library/toolkit
Node.js Getting Started &amd Best Practices
Untangling - fall2017 - week 7
Gatsby vs. Next.js
Untangling - fall2017 - week6
Ad

Viewers also liked (8)

PDF
Learn to Be an Autism Entrepreneur
PDF
Frontend Development - Supercharge your frontend development with little lang...
PPTX
Intro to rising tide way
PPTX
Grunt Continuous Development of the Front End Tier
PDF
Uk norway ib directory
TXT
Mac interval tree
PDF
[AWSマイスターシリーズ] AWS CLI / AWS Tools for Windows PowerShell
PDF
JAWS-UG Meets Windows (JAWS Days 2017)
Learn to Be an Autism Entrepreneur
Frontend Development - Supercharge your frontend development with little lang...
Intro to rising tide way
Grunt Continuous Development of the Front End Tier
Uk norway ib directory
Mac interval tree
[AWSマイスターシリーズ] AWS CLI / AWS Tools for Windows PowerShell
JAWS-UG Meets Windows (JAWS Days 2017)
Ad

Similar to Coffee script throwdown (20)

PDF
Writing Bullet-Proof Javascript: By Using CoffeeScript
PDF
Smooth CoffeeScript
PPTX
Foolangjs
PDF
The JavaScript Delusion
PDF
JavaScript: Past, Present, Future
PDF
Why I will never write JavaScript ever again*
PDF
DSLs in JavaScript
PDF
Let’s learn how to use JavaScript responsibly and stay up-to-date.
PDF
Survive JavaScript - Strategies and Tricks
PDF
Coffeescript unfancy javascript
PPTX
Confoo - Javascript Server Side : How to start
PPTX
What is Mean Stack Development ?
PDF
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
PDF
General Assembly Workshop: Advanced JavaScript
PDF
There is something about JavaScript - Choose Forum 2014
PPT
CoffeeScript: A beginner's presentation for beginners copy
PDF
Node.js #digpen presentation
PPTX
Javascript Apps at Build Artifacts
PDF
Kann JavaScript elegant sein?
PDF
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
Writing Bullet-Proof Javascript: By Using CoffeeScript
Smooth CoffeeScript
Foolangjs
The JavaScript Delusion
JavaScript: Past, Present, Future
Why I will never write JavaScript ever again*
DSLs in JavaScript
Let’s learn how to use JavaScript responsibly and stay up-to-date.
Survive JavaScript - Strategies and Tricks
Coffeescript unfancy javascript
Confoo - Javascript Server Side : How to start
What is Mean Stack Development ?
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
General Assembly Workshop: Advanced JavaScript
There is something about JavaScript - Choose Forum 2014
CoffeeScript: A beginner's presentation for beginners copy
Node.js #digpen presentation
Javascript Apps at Build Artifacts
Kann JavaScript elegant sein?
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps

More from Nicholas McClay (7)

PDF
Intro to Sail.js
PDF
Node.js and Parse
PPT
Get MEAN! Node.js and the MEAN stack
PPT
Node.js Cloud deployment
KEY
Node.js 0.8 features
KEY
Node.js and NoSQL
PPTX
Node.js debugging
Intro to Sail.js
Node.js and Parse
Get MEAN! Node.js and the MEAN stack
Node.js Cloud deployment
Node.js 0.8 features
Node.js and NoSQL
Node.js debugging

Recently uploaded (20)

PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
cuic standard and advanced reporting.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
KodekX | Application Modernization Development
PDF
Approach and Philosophy of On baking technology
PPTX
Spectroscopy.pptx food analysis technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Cloud computing and distributed systems.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
cuic standard and advanced reporting.pdf
The AUB Centre for AI in Media Proposal.docx
Reach Out and Touch Someone: Haptics and Empathic Computing
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
KodekX | Application Modernization Development
Approach and Philosophy of On baking technology
Spectroscopy.pptx food analysis technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Network Security Unit 5.pdf for BCA BBA.
20250228 LYD VKU AI Blended-Learning.pptx
Understanding_Digital_Forensics_Presentation.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Cloud computing and distributed systems.
Dropbox Q2 2025 Financial Results & Investor Presentation
Per capita expenditure prediction using model stacking based on satellite ima...
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton

Coffee script throwdown