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
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
96
Impressoras 3D
ricardobeat
0
130
Other Decks in Programming
See All in Programming
AI 駆動開発におけるコミュニティと AWS CDK の価値
konokenj
5
300
SwiftDataを使って10万件のデータを読み書きする
akidon0000
0
250
Introducing RemoteCompose: break your UI out of the app sandbox.
camaelon
2
160
Leading Effective Engineering Teams in the AI Era
addyosmani
7
680
iOSでSVG画像を扱う
kishikawakatsumi
0
180
ドメイン駆動設計のエッセンス
masuda220
PRO
15
6.5k
SODA - FACT BOOK(JP)
sodainc
1
9k
Reactive Thinking with Signals and the Resource API
manfredsteyer
PRO
0
120
CSC305 Lecture 10
javiergs
PRO
0
320
フロントエンド開発のためのブラウザ組み込みAI入門
masashi
7
3.6k
kiroとCodexで最高のSpec駆動開発を!!数時間で web3ネイティブなミニゲームを作ってみたよ!
mashharuki
0
990
3年ぶりにコードを書いた元CTOが Claude Codeと30分でMVPを作った話
maikokojima
0
710
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Speed Design
sergeychernyshev
32
1.2k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
190
55k
Raft: Consensus for Rubyists
vanstee
140
7.2k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.2k
Designing for Performance
lara
610
69k
Bash Introduction
62gerente
615
210k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
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