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
PPT
CoffeeScript: A beginner's presentation for beginners copy
PDF
Writing Bullet-Proof Javascript: By Using CoffeeScript
PPT
Coffee script throwdown
PDF
Coffeescript unfancy javascript
PDF
Why I will never write JavaScript ever again*
PPTX
CoffeeScript the Awesome
PPTX
FutureDev / Love'Script
KEY
RingoJS: Server-Side Javascript When Only Java Will Do
PDF
CoffeeScript: The Good Parts
PDF
Developing cross platform desktop application with Ruby
PDF
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
PDF
Boxen: How to Manage an Army of Laptops
PDF
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
KEY
Plataforma java
PDF
Advanced JavaScript build pipelines using Gulp.js
PPT
Goodparts
PDF
Ajhc Haskell Compiler with Reentrant GC
PPT
Rails Vs CakePHP
ODP
EuRuKo JRuby Talk 2008
CoffeeScript-Ruby-Tuesday
CoffeeScript: A beginner's presentation for beginners copy
Writing Bullet-Proof Javascript: By Using CoffeeScript
Coffee script throwdown
Coffeescript unfancy javascript
Why I will never write JavaScript ever again*
CoffeeScript the Awesome
FutureDev / Love'Script
RingoJS: Server-Side Javascript When Only Java Will Do
CoffeeScript: The Good Parts
Developing cross platform desktop application with Ruby
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
Boxen: How to Manage an Army of Laptops
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Plataforma java
Advanced JavaScript build pipelines using Gulp.js
Goodparts
Ajhc Haskell Compiler with Reentrant GC
Rails Vs CakePHP
EuRuKo JRuby Talk 2008

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
CoffeeScript
PDF
API Design
PDF
測試
PDF
3rd AS Study Group
KEY
iOS Game Development with Cocos2d
KEY
AS3讀書會(行前準備)
PDF
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
CoffeeScript
API Design
測試
3rd AS Study Group
iOS Game Development with Cocos2d
AS3讀書會(行前準備)

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Approach and Philosophy of On baking technology
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
KodekX | Application Modernization Development
PDF
cuic standard and advanced reporting.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Encapsulation theory and applications.pdf
Encapsulation_ Review paper, used for researhc scholars
Diabetes mellitus diagnosis method based random forest with bat algorithm
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
The Rise and Fall of 3GPP – Time for a Sabbatical?
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Approach and Philosophy of On baking technology
Digital-Transformation-Roadmap-for-Companies.pptx
Network Security Unit 5.pdf for BCA BBA.
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
KodekX | Application Modernization Development
cuic standard and advanced reporting.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Review of recent advances in non-invasive hemoglobin estimation
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
sap open course for s4hana steps from ECC to s4
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Understanding_Digital_Forensics_Presentation.pptx
Encapsulation theory and applications.pdf

Happy Programming with CoffeeScript