Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Clean up your javascript act

1,866 views

Published on

Slides from my JavaScript session at DDD North, 2011.

Published in: Technology
  • Login to see the comments

  • Be the first to like this

Clean up your javascript act

  1. 1. Clean Up Your JavaScript Act<br />AshicMahtabhttp://www.heartysoft.com@ashic<br />
  2. 2. JavaScript<br />Messy<br />Dangerous<br />Extremely flexible…too flexible?<br />
  3. 3. JavaScript<br />Following a few simple patterns (“The Good Parts”) can make it manageable. <br />Writing tests…need I even ask?<br />
  4. 4. JavaScript Testing<br />QUnit<br />Chutzpah<br />Build Script<br />TeamCity<br />Demo<br />
  5. 5. QUnit<br />test<br />module<br /> ok<br />equal<br />stop<br />start<br />
  6. 6. Objects<br />var person = { ‘name’ : ‘john’, ‘yearOfBirth’ : 1912, ‘saying’ : function(){ <br /> alert(“I was on board the Titanic!”); }};Good for simple data structures…attempt to do complicated stuff and you will suffer :@<br />
  7. 7. Functional Objects<br />Demo<br />Basics up to inheritance<br />
  8. 8. Gotcha<br />Ruining this<br />
  9. 9. Knockout<br />JavaScript MVVM framework<br />Awesome<br />
  10. 10. Resources / Links<br />Get Crockford’sbook (Javascript: The Good Parts)<br />http://chutzpah.codeplex.com<br />http://www.knockoutjs.com<br />

×