Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
99
Impressoras 3D
ricardobeat
0
130
Other Decks in Programming
See All in Programming
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
190
CSC305 Lecture 17
javiergs
PRO
0
340
ViewファーストなRailsアプリ開発のたのしさ
sugiwe
0
430
ソフトウェア設計の課題・原則・実践技法
masuda220
PRO
26
22k
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
120
React Native New Architecture 移行実践報告
taminif
1
150
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
120
30分でDoctrineの仕組みと使い方を完全にマスターする / phpconkagawa 2025 Doctrine
ttskch
3
790
開発に寄りそう自動テストの実現
goyoki
1
750
STYLE
koic
0
150
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
6
980
ローターアクトEクラブ アメリカンナイト:川端 柚菜 氏(Japan O.K. ローターアクトEクラブ 会長):2720 Japan O.K. ロータリーEクラブ2025年12月1日卓話
2720japanoke
0
720
Featured
See All Featured
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
390
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
69k
For a Future-Friendly Web
brad_frost
180
10k
YesSQL, Process and Tooling at Scale
rocio
174
15k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Embracing the Ebb and Flow
colly
88
4.9k
Side Projects
sachag
455
43k
Unsuck your backbone
ammeep
671
58k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
54k
Visualization
eitanlees
150
16k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
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