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
110
Impressoras 3D
ricardobeat
0
140
Other Decks in Programming
See All in Programming
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
130
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
7
2.3k
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
450
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
230
SourceGeneratorのススメ
htkym
0
200
Oxlint JS plugins
kazupon
1
940
Basic Architectures
denyspoltorak
0
670
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
730
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
200
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
6
1.8k
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
140
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
110
Featured
See All Featured
Fireside Chat
paigeccino
41
3.8k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
770
GraphQLとの向き合い方2022年版
quramy
50
14k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
180
What does AI have to do with Human Rights?
axbom
PRO
0
2k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Marketing to machines
jonoalderson
1
4.6k
How to build a perfect <img>
jonoalderson
1
4.9k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
320
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
240
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