• Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
664
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
2
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. 10 razões para você usar CoffeeScript e se apaixonar... Lukas AlexandreSaturday, January 19, 13
  • 2. 1-Sintaxe limpa • Inspirada em Ruby e Python; • Parênteses opcionais; message = Hello World sayHello messageSaturday, January 19, 13
  • 3. 2-Impõe boas práticas de JS • Escopos fechados; • Previne “global namespace flooding”; sayHello = (message) -> (function() { console.log message var sayHello; sayHello Hello World sayHello = function(message) { return console.log(message); }; sayHello(Hello World); }).call(this);Saturday, January 19, 13
  • 4. 3-Fat Arrow • Workarounds imbutidos; coffee = var coffee = { isFull: true isFull: true, watchDrink: -> watchDrink: function(){ $(.drink a).on click, => var that = this; @isFull = false $(.drink a).on(click, function(){ that.isFull = false; }); } }Saturday, January 19, 13
  • 5. 4-Interpolação de strings • Chega de + + + + name = John Doe var name = John Doe; console.log "Hi, my name is #{name}" console.log("Hi, my name is " + "name")Saturday, January 19, 13
  • 6. 5-List Comprehensions names = [Foo, Bar, Baz] var names = [Foo, Bar, Baz]; console.log(name) for name in names for(var i=0; i < names.length; i++){ console.log(names[i]); }Saturday, January 19, 13
  • 7. 6-Modificadores Condicionais allowEntrance() unless age < 21 if(age > 21) { allowEntrance() if age >= 21 allowEntrance() } if(age >= 21) { allowEntrance() }Saturday, January 19, 13
  • 8. 7-Classes class Coffee constructor: (@name) -> brew: -> console.log Brewing description: -> console.log "Coffee is #{@name}" frenchCoffee = new Coffee(French) frenchCoffee.description # Coffee is FrenchSaturday, January 19, 13
  • 9. 8-Uma visão do futuro • Suporte de Brendan Eich; • @ e => no JS;Saturday, January 19, 13
  • 10. 9-Aceitação da comunidade • Rails >= 3.1; • Python & PHP; • Unit Testing frameworks;Saturday, January 19, 13
  • 11. 10-Ótimas fontes de aprendizado • http://coffeescript.org • http://coffeescriptcookbook.com • http://www.codeschool.com/courses/ coffeescriptSaturday, January 19, 13
  • 12. Contato • pessoal: lukasalexandre@me.com • profissional: lukas@codelogic.me • http://github.com/lukasalexandreSaturday, January 19, 13
  • 13. Perguntas?Saturday, January 19, 13
  • 14. Referências • http://www.netmagazine.com/features/10- good-reasons-use-coffeescriptSaturday, January 19, 13