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
200
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
110
Impressoras 3D
ricardobeat
0
140
Other Decks in Programming
See All in Programming
初めてのKubernetes 本番運用でハマった話
oku053
0
130
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
150
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
2
1.5k
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
360k
SREは、MCPとSRE Agentをこう使え!
kazumax55
0
150
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
390
吝嗇家のためのAI活用 / AI development for miser - ChatGPT + Issue Driven Development
tooppoo
0
190
yield再入門 #phpcon
o0h
PRO
0
460
Embedded SREと共に達成した会員管理システムのAWS移行 - SRE NEXT 2026 ランチスポンサーセッション
niftycorp
PRO
1
2.6k
アルゴリズムは何を圧縮しているのか ─ Haskell から育った「圧縮代数」というメンタルモデル
naoya
16
3.5k
act2-costs.pdf
sumedhbala
0
110
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
2
530
Featured
See All Featured
Claude Code のすすめ
schroneko
67
230k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.8k
Navigating Weather and Climate Data
rabernat
0
370
BBQ
matthewcrist
89
10k
Practical Orchestrator
shlominoach
191
11k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
220
My Coaching Mixtape
mlcsv
0
170
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
630
Facilitating Awesome Meetings
lara
57
7k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
220
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
390
Into the Great Unknown - MozCon
thekraken
41
2.6k
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