SlideShare a Scribd company logo
Happy Programming with CoffeeScript




                                 高見見龍龍
photo by yukop
高見見龍龍
a.k.a Eddie or Aquarianboy
 Live and work in Taipei, Taiwan.
 Serving in my own little tiny company.
 Flash / AS3 / Ruby / Rails / Python programming for living.
 Mac OS user, Objective-C for personal inerests.
 Technical Education and Consulant.
 PTT Flash BM (since 2007/4).
 Ruby Certified Programmer (Since 2012/1).
 Adobe Certified Flash Developer (Since 2006/7).
 Linux Professional Institue Certification (Since 2005/3).     photo by Eddie
Happy Programming with CoffeeScript
Intro
 簡介
Popular
Popular

Powerful
Popular

 Powerful

Complicaed
Before   photo by Razlan
photo by Razlan
                  Now
seems
                         easy
photo by apple apple
photo by Marcus Q
Today, I am going o ell you..
Happy
 快樂
We’re not
                       alking
                    about this
                       kind of
                       coffee.

photo by Nick Humphries
Not this either.




photo by naotoj
I have no idea why engineers like
using food as their project name.
Jeremy
Ashkenas
       photo by jsconf
2009/12
and I sared o use
CoffeeScript since 2011/5
and I sared o use
CoffeeScript since 2011/5

   because of Rails
Happy Programming with CoffeeScript
yet another new language !?
Happy Programming with CoffeeScript
"It's just JavaScript"
just writen in different synax
borrowed from
Python, Ruby and Haskell.
and would be compiled ino
     JavaScript code
JSLint Compatible
So, it's still Javascript
"hmm.."
"It's just JavaScript"
"It's just JavaScript"
"I think it's just CoffeeScript"
whaever..

WTH can you do with
   CoffeeScript?
anything which JavaScript can do.
front-end, back-end, mobile.. ec.
but with less line of code..
        ~ 30% off
CoffeeScript compiler is writen in
           CoffeeScript
Is
                         JavaScript
                              that
                              bad?
photo by Bryan Gosline
the good parts
photo by Steve Ganz
CoffeeScript =
English-like grammar +
nice Synactic Sugar +
        Goodies
Syntax
  語法
indenations rule,
whiespace maters!
}
        }
    }
}
}
        }
    }
}
Happy Programming with CoffeeScript
String Inerpolation
greeting = "hi, " + name + ", " + msg
greeting = "hi, #{name}, #{msg}"
semicolon
semicolon
var
var
->
say_hello = (msg) ->
   console.log "hello, JSDC"
var say_hello;
say_hello = function(msg) {
   return console.log("hello, JSDC");
};
default parameer
say_something = (msg = "JSDC") ->
 console.log "say #{msg}"
var say_something;

say_something = function(msg) {
   if (msg == null) {
      msg = "JSDC";
   }
   return console.log("say " + msg);
};
( ) is not always necessary.
greeting("eddie", "how are you");
greeting "eddie", "how are you"
everything is an expression
return is not necessary.
var hello;

hello = function() {
   return "hi, JSDC";
};
hello = ->
 "hi, JSDC"
Array
var a;
a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
a = [1..10]
Loop
console.log i for i in [1..10]
var i, _i;

for (i = _i = 1; _i <= 10; i = ++_i) {
  console.log(i);
}
console.log "YES" if oday == 'JSDC'
Sugar
yes, no
A: “would you marry me?”
          B: true
A: “would you marry me?”
          B: yes
console.log "go home" if oday isnt "JSDC"
OO
Hello.prootype.greeting = function(name) {
   console.log("hi, " + name);
};
class Hello
    greeting: (name) ->
       console.log "hi, #{name}"
class Hello
  construcor: (@name) ->

 greeting: (msg) ->
   "hi, #{@name}, #{msg}"
var Hello;
Hello = (function() {
   Hello.name = 'Hello';
   function Hello(name) {
      this.name = name;
   }
   Hello.prootype.greeting = function(msg) {
      return "hi, " + this.name + ", " + msg;
   };
   return Hello;
})();
Diff?
 差別?
the Original Way

  Your Brain

  JavaScript

   Browser
the CoffeeScript way

    Your Brain

   CoffeeScript

    JavaScript

     Browser
Happy Programming with CoffeeScript
lots of languages that compile o JS
           http://goo.gl/nkAkQ
Ref
參考
RTFM, it's awesome!
   http://coffeescript.org/
or my shameless promotion blog
 http://blog.eddie.com.tw/caegory/coffeescript/
Let’s get our feet wet!
photo by jlhopes
Demo
 展示
But..
 巴特..
CoffeeScript is not so perfect
Readability != Comprehension
People may still wrie
CoffeeScript as horribly as they
       wroe JavaScript..
indenations rule,
whiespace maters!
( ) is not always necessary.
Debugging ool?
You've beter have a human
CoffeeScript compiler in your head!
Then..
  然後..
CoffeeScript is not used o replace
            JavaScript.
If you don’t know Javascript, and
you think CoffeeScript can save
your life..
you would be in trouble.
So..
 所以..
Who is using CoffeeScript?
actually, I don't really care!
Who won't need this?
People who don't like CoffeeScript.
People who already know
javascript(the good parts) very
well.
Who might need/like this?
someone who don't like ;
someone who don't like { }
someone who don't like the
      PROTOTYPE.
Rails developer
Anyway
  總之
Should I learn CoffeeScript?
Is it worth it?
IMHO
 拙見
You should..
learn JavaScript!
learn JavaScript!
learn JavaScript!
learn JavaScript!
.. and use CoffeeScript !
oally worth it!
I can't go back
   anymore!
give it a try
Happy?
  快樂?
END
 結束
Conacts
高見見龍龍   Websie
        Blog
                   http://www.eddie.com.tw
                   http://blog.eddie.com.tw
        Plurk      http://www.plurk.com/aquarianboy
        Facebook   http://www.facebook.com/eddiekao
        Google Plus http://www.eddie.com.tw/+
        Twiter    https://twiter.com/#!/eddiekao
        Email      eddie@digik.com.tw
        Mobile     +886-928-617-687




                                                      photo by Eddie

More Related Content

KEY
CoffeeScript presentation
KEY
End to-End CoffeeScript
PDF
CoffeeScript Design Patterns
PDF
CoffeeScript in 5mins
PDF
Coffeescript: An Opinionated Introduction
PPTX
Coffee scriptisforclosers nonotes
PDF
Boxen: How to Manage an Army of Laptops and Live to Talk About It
PPTX
Reasons To Love Ruby
CoffeeScript presentation
End to-End CoffeeScript
CoffeeScript Design Patterns
CoffeeScript in 5mins
Coffeescript: An Opinionated Introduction
Coffee scriptisforclosers nonotes
Boxen: How to Manage an Army of Laptops and Live to Talk About It
Reasons To Love Ruby

What's hot (20)

PDF
CoffeeScript, An Introduction for Nodejs developers
PDF
Bundler is the Best
PDF
Drupal + selenium
PDF
Ruby on Rails Presentation
PDF
When To Use Ruby On Rails
PPT
Calabash automated test
ODP
Ruby on Rails
PPTX
CoffeeScript - An Introduction
PDF
Coffeescript - take a sip of code
KEY
Javascript orientado a testes
KEY
Ruby v cpp_preso
PDF
Ruby and Rails by example
PPT
Object Oriented JavaScript
PDF
DevOps introduction with ansible, vagrant, and docker
PDF
Writing Software not Code with Cucumber
PDF
App Lego
PDF
JRuby on Rails, Flying Saucer
ODP
MySQL::Replication (Melbourne Perl Mongers 2011-07)
PDF
Découplez votre appli en micro-APIs
ZIP
Palestra VCR
CoffeeScript, An Introduction for Nodejs developers
Bundler is the Best
Drupal + selenium
Ruby on Rails Presentation
When To Use Ruby On Rails
Calabash automated test
Ruby on Rails
CoffeeScript - An Introduction
Coffeescript - take a sip of code
Javascript orientado a testes
Ruby v cpp_preso
Ruby and Rails by example
Object Oriented JavaScript
DevOps introduction with ansible, vagrant, and docker
Writing Software not Code with Cucumber
App Lego
JRuby on Rails, Flying Saucer
MySQL::Replication (Melbourne Perl Mongers 2011-07)
Découplez votre appli en micro-APIs
Palestra VCR
Ad

Viewers also liked (12)

PDF
CoffeeScriptってなんぞ?
PDF
Wynn Netherland: Accelerating Titanium Development with CoffeeScript, Compass...
PDF
Introduction to CoffeeScript
PDF
JavaScript Library Overview
KEY
Web Development with CoffeeScript and Sass
PDF
Scalable JavaScript Design Patterns
PPT
JavaScript - An Introduction
KEY
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
PDF
Scalable JavaScript Application Architecture
PPTX
イベント・ソーシングを知る
PDF
JavaScript Programming
PDF
Javascript Best Practices
CoffeeScriptってなんぞ?
Wynn Netherland: Accelerating Titanium Development with CoffeeScript, Compass...
Introduction to CoffeeScript
JavaScript Library Overview
Web Development with CoffeeScript and Sass
Scalable JavaScript Design Patterns
JavaScript - An Introduction
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Scalable JavaScript Application Architecture
イベント・ソーシングを知る
JavaScript Programming
Javascript Best Practices
Ad

Similar to Happy Programming with CoffeeScript (20)

PDF
CoffeeScript-Ruby-Tuesday
PDF
CoffeeScript
PDF
Smooth CoffeeScript
PDF
CoffeeScript - TechTalk 21/10/2013
PDF
Coffeescript
PPT
Coffee script throwdown
PPTX
Overview of CoffeeScript
PPT
CoffeeScript: A beginner's presentation for beginners copy
PDF
CoffeeScript: The Good Parts
PDF
Coffeescript intro
ODP
Coffeescript: Fad or Useful Tool? Socal Code Camp Fullerton 2015
PPTX
Introduction to Coffeescript
PDF
Writing Bullet-Proof Javascript: By Using CoffeeScript
PPTX
Coffee script
PDF
Coffeescript unfancy javascript
PDF
Coffeescript: No really, it's just Javascript
PDF
Coffee Script
PDF
FITC Sneak Peek 2012
KEY
CoffeeScript: JavaScript, but Better!
PDF
CoffeeScript
CoffeeScript-Ruby-Tuesday
CoffeeScript
Smooth CoffeeScript
CoffeeScript - TechTalk 21/10/2013
Coffeescript
Coffee script throwdown
Overview of CoffeeScript
CoffeeScript: A beginner's presentation for beginners copy
CoffeeScript: The Good Parts
Coffeescript intro
Coffeescript: Fad or Useful Tool? Socal Code Camp Fullerton 2015
Introduction to Coffeescript
Writing Bullet-Proof Javascript: By Using CoffeeScript
Coffee script
Coffeescript unfancy javascript
Coffeescript: No really, it's just Javascript
Coffee Script
FITC Sneak Peek 2012
CoffeeScript: JavaScript, but Better!
CoffeeScript

More from Eddie Kao (20)

PDF
Rails girls in Taipei
PDF
Rails Girls in Taipei
PDF
Let's Learn Ruby - Basic
PDF
iOS app development and Open Source
PDF
PDF
from Ruby to Objective-C
PDF
Code Reading
PDF
CreateJS - from Flash to Javascript
PDF
May the source_be_with_you
PDF
Why I use Vim
PDF
There is something about Event
PDF
Flash Ecosystem and Open Source
PDF
Ruby without rails
PDF
API Design
PDF
測試
PDF
3rd AS Study Group
KEY
iOS Game Development with Cocos2d
KEY
AS3讀書會(行前準備)
PDF
PDF
Misunderstanding about flash
Rails girls in Taipei
Rails Girls in Taipei
Let's Learn Ruby - Basic
iOS app development and Open Source
from Ruby to Objective-C
Code Reading
CreateJS - from Flash to Javascript
May the source_be_with_you
Why I use Vim
There is something about Event
Flash Ecosystem and Open Source
Ruby without rails
API Design
測試
3rd AS Study Group
iOS Game Development with Cocos2d
AS3讀書會(行前準備)
Misunderstanding about flash

Recently uploaded (20)

PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
Cloud computing and distributed systems.
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Empathic Computing: Creating Shared Understanding
PDF
Modernizing your data center with Dell and AMD
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
Machine learning based COVID-19 study performance prediction
PDF
cuic standard and advanced reporting.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Cloud computing and distributed systems.
Reach Out and Touch Someone: Haptics and Empathic Computing
Mobile App Security Testing_ A Comprehensive Guide.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Dropbox Q2 2025 Financial Results & Investor Presentation
Empathic Computing: Creating Shared Understanding
Modernizing your data center with Dell and AMD
Big Data Technologies - Introduction.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
The Rise and Fall of 3GPP – Time for a Sabbatical?
The AUB Centre for AI in Media Proposal.docx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
MYSQL Presentation for SQL database connectivity
Diabetes mellitus diagnosis method based random forest with bat algorithm
GamePlan Trading System Review: Professional Trader's Honest Take
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Machine learning based COVID-19 study performance prediction
cuic standard and advanced reporting.pdf

Happy Programming with CoffeeScript