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
170
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
85
Impressoras 3D
ricardobeat
0
130
Other Decks in Programming
See All in Programming
try! Swift Tokyo 初参加報告LT
hinakko2
0
210
見た目から始める生産性向上
ikumatadokoro
7
780
educure_カリキュラム生操作マニュアル.pdf
linew_official
0
660
Compose-View Interop in Practice (mDevCamp 2024)
stewemetal
0
110
Semantic search with Django and pgvector
pauloxnet
0
240
冗長なエラーログを削減し、スタックトレースを手に入れる / Reducing Verbose Error Logs and Obtaining Stack Traces
upamune
0
220
Milestoner
bkuhlmann
1
410
使ってみよう Azure AI Document Intelligence
kosmosebi
2
270
雑に思考を整理する技術と効能
konifar
58
28k
⼤規模⾔語モデルの拡張(RAG)が 終わったかも知れない件について
nearme_tech
23
15k
Changed Rules: Architectures with Lightweight Stores
manfredsteyer
PRO
0
240
Code Reviews
bkuhlmann
4
890
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
41
12k
Become a Pro
speakerdeck
PRO
10
4.5k
Art, The Web, and Tiny UX
lynnandtonic
288
19k
Building a Modern Day E-commerce SEO Strategy
aleyda
16
6.4k
In The Pink: A Labor of Love
frogandcode
138
21k
Testing 201, or: Great Expectations
jmmastey
27
6.3k
Done Done
chrislema
178
15k
Building an army of robots
kneath
300
41k
Automating Front-end Workflow
addyosmani
1355
200k
4 Signs Your Business is Dying
shpigford
175
21k
Making Projects Easy
brettharned
108
5.5k
The Mythical Team-Month
searls
215
42k
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