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
180
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
94
Impressoras 3D
ricardobeat
0
130
Other Decks in Programming
See All in Programming
PostgreSQLのRow Level SecurityをPHPのORMで扱う Eloquent vs Doctrine #phpcon #track2
77web
2
340
deno-redisの紹介とJSRパッケージの運用について (toranoana.deno #21)
uki00a
0
150
Gleamという選択肢
comamoca
6
760
Bytecode Manipulation 으로 생산성 높이기
bigstark
2
380
LINEヤフー データグループ紹介
lycorp_recruit_jp
0
890
Go1.25からのGOMAXPROCS
kuro_kurorrr
1
800
PHPでWebSocketサーバーを実装しよう2025
kubotak
0
160
アンドパッドの Go 勉強会「 gopher 会」とその内容の紹介
andpad
0
260
AIコーディング道場勉強会#2 君(エンジニア)たちはどう生きるか
misakiotb
1
250
生成AIで日々のエラー調査を進めたい
yuyaabo
0
650
型付きアクターモデルがもたらす分散シミュレーションの未来
piyo7
0
810
Java on Azure で LangGraph!
kohei3110
0
170
Featured
See All Featured
Gamification - CAS2011
davidbonilla
81
5.3k
It's Worth the Effort
3n
185
28k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
GraphQLとの向き合い方2022年版
quramy
48
14k
Site-Speed That Sticks
csswizardry
10
660
For a Future-Friendly Web
brad_frost
179
9.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.8k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Facilitating Awesome Meetings
lara
54
6.4k
Build The Right Thing And Hit Your Dates
maggiecrowley
36
2.8k
What's in a price? How to price your products and services
michaelherold
246
12k
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