Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introdução a CoffeeScript
Search
Ricardo Tomasi
March 03, 2012
Programming
1
190
Introdução a CoffeeScript
Palestra para o RSJS 2012 (
http://rsjs.org
)
Ricardo Tomasi
March 03, 2012
Tweet
Share
More Decks by Ricardo Tomasi
See All by Ricardo Tomasi
Construindo aplicações web com Backbone e Node.js
ricardobeat
3
110
Impressoras 3D
ricardobeat
0
140
Other Decks in Programming
See All in Programming
Go Conference mini in Sendai 2026 : Goに新機能を提案し実装されるまでのフロー徹底解説
yamatoya
0
560
文字コードの話
qnighy
44
17k
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
820
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
380
株式会社 Sun terras カンパニーデック
sunterras
0
2.1k
15年目のiOSアプリを1から作り直す技術
teakun
1
620
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
370
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
200
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
2
550
AI主導でFastAPIのWebサービスを作るときに 人間が構造化すべき境界線
okajun35
0
690
Unity6.3 AudioUpdate
cova8bitdots
0
120
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
940
Featured
See All Featured
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
140
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
180
For a Future-Friendly Web
brad_frost
183
10k
Building an army of robots
kneath
306
46k
Everyday Curiosity
cassininazir
0
160
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
140
Done Done
chrislema
186
16k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.8k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Crafting Experiences
bethany
1
81
Raft: Consensus for Rubyists
vanstee
141
7.4k
Transcript
None
@ricardobeat about.me/ricardotomasi
None
"CoffeeScript is an attempt to expose the good parts of
Javascript in a simple way"
Características - indentação obrigatória - tudo é uma expressão -
é apenas javascript - mapeamento 1 x 1 (ideal) - não é um superset do javascript
Variáveis e escopo - sem “var” - variable safety -
globais explícitas
Funções - parâmetros entre parênteses - seta - corpo da
função
Funções
Funções splats defaults
Objetos - { ... } opcionais - vírgulas opcionais -
protege nomes reservados
Arrays indexOf
Range literals, slicing, splicing
Array de objetos
Condicionais
Loops e compreensões
None
Loops e compreensões
Haskell
Ruby
Javascript
None
Dart
Operadores aliases
Outros this prototype
Operadores
Operadores existential operator
Operadores conditional assignment
Operadores chained comparisons
Strings interpolação
Strings
Strings multi-linha
Expressões regulares
jQuery
None
Classes
outros exemplos passed = [] failed = [] (if score
> 60 then passed else failed).push score for score in [49, 58, 76, 82, 88, 90] console.log "Happy Birthday #{if i is 3 then "dear Robert" else "to You"}" for i in [1..4] http://rosettacode.org/wiki/Category:CoffeeScript
Debug erros apontam para o source javascript futuro: source-mapping
Como usar 1. instalar node.js (?) 2. npm install coffee-script
-g
None
Demo http://192.168.254.109:8080