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
カクヨムAndroidアプリのリブート
numeroanddev
0
410
「ElixirでIoT!!」のこれまでとこれから
takasehideki
0
350
List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfold' relates to 'iterate'"
philipschwarz
PRO
0
190
Cloudflare Realtime と Workers でつくるサーバーレス WebRTC
nekoya3
0
400
アンドパッドの Go 勉強会「 gopher 会」とその内容の紹介
andpad
0
150
Javaのルールをねじ曲げろ!禁断の操作とその代償から学ぶメタプログラミング入門 / A Guide to Metaprogramming: Lessons from Forbidden Techniques and Their Price
nrslib
3
1.9k
Select API from Kotlin Coroutine
jmatsu
1
110
Rails産でないDBを Railsに引っ越すHACK - Omotesando.rb #110
lnit
1
160
実践ArchUnit ~実例による検証パターンの紹介~
ogiwarat
2
250
TypeScript LSP の今までとこれから
quramy
1
500
事業戦略を理解してソフトウェアを設計する
masuda220
PRO
22
6k
Datadog RUM 本番導入までの道
shinter61
1
260
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
92
6.1k
Side Projects
sachag
454
42k
Music & Morning Musume
bryan
46
6.6k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
Balancing Empowerment & Direction
lara
1
290
Building Applications with DynamoDB
mza
95
6.4k
RailsConf 2023
tenderlove
30
1.1k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
14
1.5k
For a Future-Friendly Web
brad_frost
179
9.8k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
35
2.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