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
210
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Introdução a CoffeeScript
Palestra para o RSJS 2012 (
http://rsjs.org
)
Ricardo Tomasi
March 03, 2012
More Decks by Ricardo Tomasi
See All by Ricardo Tomasi
Construindo aplicações web com Backbone e Node.js
ricardobeat
3
120
Impressoras 3D
ricardobeat
0
150
Other Decks in Programming
See All in Programming
AIの中の人になってみる
htkym
0
140
初めての模倣学習とVLA
natsutan
0
330
リアルな遅延を測る仕様
kota_yata
1
130
GKE アップグレード前に知っておきたい Blue/Green と PDB の関係
stkk
0
110
freee が目指す データ マネジメント戦略 AI-Ready 時代を支える 攻めのガバナンスとは
freee
PRO
0
530
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
260
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
3.9k
高専キャリア LT 発表内容
crysta1221
6
4.9k
Flow は今どうなっているか
mizdra
PRO
0
770
React本体のコードリーディング
high_g_engineer
1
160
引き算の組織 ― アウトカムとAIに全振りするために辞めたこと ― / Organization by Subtraction
hirokiyamamoto14
PRO
0
320
Oxlintはいいぞ(続)
yug1224
1
490
Featured
See All Featured
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
220
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
480
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
Tell your own story through comics
letsgokoyo
1
1.1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
220
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
480
KATA
mclloyd
PRO
35
15k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
520
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
From π to Pie charts
rasagy
0
330
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