a sip of coffee mauricia ragland

31
A SIP OF COFFEESCRIPT TO GET YOU STARTED FRONT END DEVELOPERS OF MIAMI March 27, 2013 Created by / SURVEY Mauricia Ragland @summnerd http://goo.gl/k9FMW

Upload: mauricia-ragland

Post on 07-Dec-2014

260 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: A sip of coffee   mauricia ragland

A SIP OFCOFFEESCRIPT

TO GET YOU STARTED

FRONT END DEVELOPERS OF MIAMI

March 27, 2013 Created by /

SURVEY

Mauricia Ragland @summnerd

http://goo.gl/k9FMW

Page 2: A sip of coffee   mauricia ragland

WHAT I WILL DISCUSS1. What CoffeeScript Is2. Why It's a Great3. A few cons4. Things to Know in Advance5. The Basics

Page 3: A sip of coffee   mauricia ragland
Page 4: A sip of coffee   mauricia ragland

COFFEESCRIPT

Page 5: A sip of coffee   mauricia ragland

WRITE ONELANGUAGE TO GET

ANOTHER?

Page 6: A sip of coffee   mauricia ragland

SO WHAT ARE THEBENEFITS?

Forces consistencyGreat when working on teamsWrites great codeGreat way to sharpen your own skillsetForces namespacingGreat Resource for learning

Page 7: A sip of coffee   mauricia ragland

SO EVERYTHING'S GREAT!NO!

Page 8: A sip of coffee   mauricia ragland

SO WHAT ARE THECONS?

Not for beginnersRequires setup Gem/NPMLearning CurveCan breed lazy developersThat's all I can think of...

Page 9: A sip of coffee   mauricia ragland

OVERALLYou can stop using CoffeeScript whenever you want

SO THERE'S NOTHING TO LOSE!

Page 10: A sip of coffee   mauricia ragland

WHAT YOU SHOULDKNOW

Page 11: A sip of coffee   mauricia ragland

WATCH YOUR SPACING

Page 12: A sip of coffee   mauricia ragland

START BY USING JS2COFFEE.ORG

Page 13: A sip of coffee   mauricia ragland

GET TEAM IN SYNC

Page 14: A sip of coffee   mauricia ragland

DO NOT EDIT JAVASCRIPT

Page 15: A sip of coffee   mauricia ragland

DO NOT START WITHTIGHT DEADLINE

Page 16: A sip of coffee   mauricia ragland

DOES NOT TAKE PLACEOF BEST PRACTICES

Page 17: A sip of coffee   mauricia ragland

INSTALLING COFFEESCRIPTNode Package Manager - NPM

Ruby Gem

Page 18: A sip of coffee   mauricia ragland

NO MANUALINSTALLATION

YES

WHY USE A PACKAGEMANAGER

Handles dependenciesEasy to versionI don't want to manage them myself

Page 19: A sip of coffee   mauricia ragland

DO NOT USE SUDOsudo chown -R $USER /usr/local

Page 20: A sip of coffee   mauricia ragland

NPM

Remove -g if you don't want a global install

npm install -g coffee-script

Page 21: A sip of coffee   mauricia ragland

GEMgem install coffee-script#Check to see if it's installedgem query local

Page 22: A sip of coffee   mauricia ragland

CODE SNIPPETSSyntax to understand to help get you going

Page 23: A sip of coffee   mauricia ragland

FUNCTIONSAre indicated by arrow

is equivalent to

example = -> x = 1 + 2

function example(){ var x = 1 + 2;}

Page 24: A sip of coffee   mauricia ragland

PARAMETERS

is equivalent to

example = ( x, y ) ->

function example( x, y ){}

Page 25: A sip of coffee   mauricia ragland

HOW TO CALL AFUNCTION

is equivalent to

example()

#When Passing params parenthesis are not neededexample x, y

example();example( x, y );

Page 26: A sip of coffee   mauricia ragland

CREATING A VARIABLE

"var" is not allowed

x = 1

#The following is incorrectvar x = 1;

Page 27: A sip of coffee   mauricia ragland

CONDITIONALSTATEMENTS

is equivalent to

example() if x and yalert() if x?

if ( x && y ) example();if (typeof x !== "undefined" && x !== null) { alert();}

Page 28: A sip of coffee   mauricia ragland

INTERPOLATION

is equivalent to

alert "My name is #{@firstName} #{@lastName}"

alert("My name is " + this.firstName + " " + this.lastName);

Page 29: A sip of coffee   mauricia ragland

COMPILING COFFEESCRIPT

watch makes the process seamless

coffee --compile --output js/ coffee/

#Use the watchcoffee --watch --compile --output js/ coffee/

Page 30: A sip of coffee   mauricia ragland

RESOURCESCOFFEESCRIPT

NPM

RUBY GEM

Code sample used during talk:

Official SiteJS2Coffee

Intro to NPM10 Things you can do with NPM

Online Manual

https://github.com/summanerd/asipofcoffee

Page 31: A sip of coffee   mauricia ragland

THE ENDBY   

 

SURVEY

MAURICIA RAGLAND@SUMMANERD

[email protected]

http://goo.gl/k9FMW