SlideShare une entreprise Scribd logo
1  sur  9
Télécharger pour lire hors ligne
*.js === bad ?


    read_on :

     browse_the_web;
Rob Robbins
  www.robrobbins.info
www.github.com/robrobbins
www.twitter.com/robrobbins
 www.jsmag.com (xdisc20)
     w's. o's, and b's oh my!
Bullets for presenters who ramble:
                       (re-reads synopsis)


The global namespace. Or not?


Closure? How many are googling now?


OO? Where did your training go?



-- next time --
CS.I? O(n) is not a new text message shorthand!
N00b vs Pirate vs Ninja

N00b                 What is the global? What's in
                     there already?


Pirate               What is a naming collision?
                     How to best avoid them?


Ninja                Explain this form:
                     (function() {} ())
The Global and you

This?                Number 1 error

Function soup?       Examples EVERYWHERE

Function scope       Versus block scope

Callbacks            Often point to window, oops

Site hierarchy       How do you spell hierarchy?

Namespaces           Can we use them?
N00b vs Pirate vs Ninja

Noob                 What is a closure?

                     Use a var referenced via
Pirate               closure


Ninja                Create a function that, given
                     an int, returns a functor which
                     when called increments or
                     decrements the original int
Now you see it. Now you do.

Revealing module     Yahoo, Douglas Crockford

This = that;         Handy scope reference

FUNCTOR              Best. Word. Ever.

call() and apply()   Allow scope manipulation
N00b vs Pirate vs Ninja

N00b                 What is OO?



Pirate               Explain JavaScript's
                     inheritance model



Ninja                Implement psuedo-classical,
                     prototypal, and functional
                     inheritance
Intrinsic FTW!

Encapsulation            Win



DRY                      Win



Separation of Concerns   Win


Magical Powers
                         Win

Contenu connexe

Similaire à Js bad_

JRuby: What's Different (RORO Melbourne October 2011)
JRuby: What's Different (RORO Melbourne October 2011)JRuby: What's Different (RORO Melbourne October 2011)
JRuby: What's Different (RORO Melbourne October 2011)Charles Nutter
 
JRuby Jam Session
JRuby Jam Session JRuby Jam Session
JRuby Jam Session Engine Yard
 
WDB005.1 - JavaScript for Java Developers (Lecture 1)
WDB005.1 - JavaScript for Java Developers (Lecture 1)WDB005.1 - JavaScript for Java Developers (Lecture 1)
WDB005.1 - JavaScript for Java Developers (Lecture 1)Igor Khotin
 
Your java script library
Your java script libraryYour java script library
Your java script libraryjasfog
 
Javascriptbootcamp
JavascriptbootcampJavascriptbootcamp
Javascriptbootcamposcon2007
 
10 Years of JavaScript
10 Years of JavaScript10 Years of JavaScript
10 Years of JavaScriptMike de Boer
 
Why JRuby? - RubyConf 2012
Why JRuby? - RubyConf 2012Why JRuby? - RubyConf 2012
Why JRuby? - RubyConf 2012Charles Nutter
 
JRuby - The Perfect Alternative
JRuby - The Perfect AlternativeJRuby - The Perfect Alternative
JRuby - The Perfect AlternativeRam Vijapurapu
 
RingoJS: Server-Side Javascript When Only Java Will Do
RingoJS:  Server-Side Javascript When Only Java Will DoRingoJS:  Server-Side Javascript When Only Java Will Do
RingoJS: Server-Side Javascript When Only Java Will DoDarren Cruse
 
03 introduction to graph databases
03   introduction to graph databases03   introduction to graph databases
03 introduction to graph databasesNeo4j
 
The Rise of Dynamic Languages
The Rise of Dynamic LanguagesThe Rise of Dynamic Languages
The Rise of Dynamic Languagesgreenwop
 
Types are eating the world
Types are eating the worldTypes are eating the world
Types are eating the worldFangda Wang
 
Invoke dynamic your api to hotspot
Invoke dynamic your api to hotspotInvoke dynamic your api to hotspot
Invoke dynamic your api to hotspotBoundary
 

Similaire à Js bad_ (20)

JRuby: What's Different (RORO Melbourne October 2011)
JRuby: What's Different (RORO Melbourne October 2011)JRuby: What's Different (RORO Melbourne October 2011)
JRuby: What's Different (RORO Melbourne October 2011)
 
JRuby Jam Session
JRuby Jam Session JRuby Jam Session
JRuby Jam Session
 
A Tale of Two Rubies
A Tale of Two RubiesA Tale of Two Rubies
A Tale of Two Rubies
 
WDB005.1 - JavaScript for Java Developers (Lecture 1)
WDB005.1 - JavaScript for Java Developers (Lecture 1)WDB005.1 - JavaScript for Java Developers (Lecture 1)
WDB005.1 - JavaScript for Java Developers (Lecture 1)
 
Your java script library
Your java script libraryYour java script library
Your java script library
 
Javascriptbootcamp
JavascriptbootcampJavascriptbootcamp
Javascriptbootcamp
 
From dot net_to_rails
From dot net_to_railsFrom dot net_to_rails
From dot net_to_rails
 
10 Years of JavaScript
10 Years of JavaScript10 Years of JavaScript
10 Years of JavaScript
 
Why JRuby? - RubyConf 2012
Why JRuby? - RubyConf 2012Why JRuby? - RubyConf 2012
Why JRuby? - RubyConf 2012
 
JRuby - The Perfect Alternative
JRuby - The Perfect AlternativeJRuby - The Perfect Alternative
JRuby - The Perfect Alternative
 
RingoJS: Server-Side Javascript When Only Java Will Do
RingoJS:  Server-Side Javascript When Only Java Will DoRingoJS:  Server-Side Javascript When Only Java Will Do
RingoJS: Server-Side Javascript When Only Java Will Do
 
Java 8 Lambda
Java 8 LambdaJava 8 Lambda
Java 8 Lambda
 
03 introduction to graph databases
03   introduction to graph databases03   introduction to graph databases
03 introduction to graph databases
 
The Rise of Dynamic Languages
The Rise of Dynamic LanguagesThe Rise of Dynamic Languages
The Rise of Dynamic Languages
 
Types are eating the world
Types are eating the worldTypes are eating the world
Types are eating the world
 
Java script unleashed
Java script unleashedJava script unleashed
Java script unleashed
 
Invoke dynamic your api to hotspot
Invoke dynamic your api to hotspotInvoke dynamic your api to hotspot
Invoke dynamic your api to hotspot
 
Ruby.new @ VilniusRB
Ruby.new @ VilniusRBRuby.new @ VilniusRB
Ruby.new @ VilniusRB
 
Typescript intro
Typescript introTypescript intro
Typescript intro
 
What Is Doctrine?
What Is Doctrine?What Is Doctrine?
What Is Doctrine?
 

Js bad_

  • 1. *.js === bad ? read_on : browse_the_web;
  • 2. Rob Robbins www.robrobbins.info www.github.com/robrobbins www.twitter.com/robrobbins www.jsmag.com (xdisc20) w's. o's, and b's oh my!
  • 3. Bullets for presenters who ramble: (re-reads synopsis) The global namespace. Or not? Closure? How many are googling now? OO? Where did your training go? -- next time -- CS.I? O(n) is not a new text message shorthand!
  • 4. N00b vs Pirate vs Ninja N00b What is the global? What's in there already? Pirate What is a naming collision? How to best avoid them? Ninja Explain this form: (function() {} ())
  • 5. The Global and you This? Number 1 error Function soup? Examples EVERYWHERE Function scope Versus block scope Callbacks Often point to window, oops Site hierarchy How do you spell hierarchy? Namespaces Can we use them?
  • 6. N00b vs Pirate vs Ninja Noob What is a closure? Use a var referenced via Pirate closure Ninja Create a function that, given an int, returns a functor which when called increments or decrements the original int
  • 7. Now you see it. Now you do. Revealing module Yahoo, Douglas Crockford This = that; Handy scope reference FUNCTOR Best. Word. Ever. call() and apply() Allow scope manipulation
  • 8. N00b vs Pirate vs Ninja N00b What is OO? Pirate Explain JavaScript's inheritance model Ninja Implement psuedo-classical, prototypal, and functional inheritance
  • 9. Intrinsic FTW! Encapsulation Win DRY Win Separation of Concerns Win Magical Powers Win