// hacking// javascript// complexity// @leJDen// Jason Denizac// CC-BY 3.0
disclaimer:a lot of this is just my opinion, man.
me:healthwise.org@boisehackersi <3 javascript
you:beyond beginning javascripthave ever thought...       Theres gotta be a better way!
{}   style     modules     testing
style        {}
sanity.          {}
{}
==     {}
== 1.   If Type(x) is the same as Type(y), then         a.         b.         c.               If Type(x) is Undefined, re...
== 1.   If Type(x) is the same as Type(y), then         a.         b.         c.               If Type(x) is Undefined, re...
===      {}
===                          {}1. Is it the same type?
===                            {}1. Is it the same type?2. Is the value the same?
===                            {}1. Is it the same type?2. Is the value the same?* NaN !== NaN
{}"Warning! JSLint will hurt your feelings."
modules
godObject.blah.foo.modulegodObject.blang.other.functionalitygodObject.something.More
A synchronousM oduleD efinition
sugarWater.jsdefine([jquery], function ($) {  return function () {    $(<strong/>)      .text(Ohh yeahh.jpg)      .appendT...
main.jsrequire([jquery, sugarWater,        domReady!],  function ($, ohhYeahh) {    $(#refreshing)    .on(click, ohhYeahh)...
require.js
microjs.com"theres a lib for that"
testing
jasmine
qunit
sinon
DEMO TIME      Using TDD, JSLint, and modules,make yet another Twitter search visualization- show me a live stream of twee...
other talks today:Next: Travis Bretton: Server side: Node.js     right hereLater: @jarodf: Client side: Backbone.js     al...
get the codegithub.com/jasondenizac/bcc12@leJDen
Hacking JavaScript Complexity - Boise Code Camp 12
Hacking JavaScript Complexity - Boise Code Camp 12
Hacking JavaScript Complexity - Boise Code Camp 12
Hacking JavaScript Complexity - Boise Code Camp 12
Hacking JavaScript Complexity - Boise Code Camp 12
Hacking JavaScript Complexity - Boise Code Camp 12
Hacking JavaScript Complexity - Boise Code Camp 12
Hacking JavaScript Complexity - Boise Code Camp 12
Hacking JavaScript Complexity - Boise Code Camp 12
Hacking JavaScript Complexity - Boise Code Camp 12
Hacking JavaScript Complexity - Boise Code Camp 12
Hacking JavaScript Complexity - Boise Code Camp 12
Upcoming SlideShare
Loading in …5
×

Hacking JavaScript Complexity - Boise Code Camp 12

1,335 views

Published on

Video: (1'15") http://www.youtube.com/watch?v=Ea0FKq0a2-g&feature=youtu.be

Materials: https://github.com/jasondenizac/bcc12

Given 3/24/2012
Boise State University

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,335
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
9
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Hacking JavaScript Complexity - Boise Code Camp 12

  1. 1. // hacking// javascript// complexity// @leJDen// Jason Denizac// CC-BY 3.0
  2. 2. disclaimer:a lot of this is just my opinion, man.
  3. 3. me:healthwise.org@boisehackersi <3 javascript
  4. 4. you:beyond beginning javascripthave ever thought... Theres gotta be a better way!
  5. 5. {} style modules testing
  6. 6. style {}
  7. 7. sanity. {}
  8. 8. {}
  9. 9. == {}
  10. 10. == 1. If Type(x) is the same as Type(y), then a. b. c. If Type(x) is Undefined, return true. If Type(x) is Null, return true. If Type(x) is Number, then {} i. If x is NaN, return false. ii. If y is NaN, return false. iii. If x is the same Number value as y, return true. iv. If x is +0 and y is −0, return true. v. If x is −0 and y is +0, return true. vi. Return false. d. If Type(x) is String, then return true if x and y are exactly the same sequence of characters (same length and same characters in corresponding positions). Otherwise, return false. e. If Type(x) is Boolean, return true if x and y are both true or both false. Otherwise, return false. f. Return true if x and y refer to the same object. Otherwise, return false. 2. If x is null and y is undefined, return true. 3. If x is undefined and y is null, return true. 4. If Type(x) is Number and Type(y) is String, 5. return the result of the comparison x == ToNumber(y). 6. If Type(x) is String and Type(y) is Number, 7. return the result of the comparison ToNumber(x) == y. 8. If Type(x) is Boolean, return the result of the comparison ToNumber(x) == y. 9. If Type(y) is Boolean, return the result of the comparison x == ToNumber(y).10. If Type(x) is either String or Number and Type(y) is Object,11. return the result of the comparison x == ToPrimitive(y).12. If Type(x) is Object and Type(y) is either String or Number,13. return the result of the comparison ToPrimitive(x) == y.14. Return false.
  11. 11. == 1. If Type(x) is the same as Type(y), then a. b. c. If Type(x) is Undefined, return true. If Type(x) is Null, return true. If Type(x) is Number, then {} i. If x is NaN, return false. ii. If y is NaN, return false. iii. If x is the same Number value as y, return true. iv. If x is +0 and y is −0, return true. t?!" v. If x is −0 and y is +0, return true. "Wa vi. Return false. d. If Type(x) is String, then return true if x and y are exactly the same sequence of characters (same length and same characters in corresponding positions). Otherwise, return false. e. If Type(x) is Boolean, return true if x and y are both true or both false. Otherwise, return false. f. Return true if x and y refer to the same object. Otherwise, return false. 2. If x is null and y is undefined, return true. 3. If x is undefined and y is null, return true. 4. If Type(x) is Number and Type(y) is String, 5. return the result of the comparison x == ToNumber(y). 6. If Type(x) is String and Type(y) is Number, 7. return the result of the comparison ToNumber(x) == y. 8. If Type(x) is Boolean, return the result of the comparison ToNumber(x) == y. 9. If Type(y) is Boolean, return the result of the comparison x == ToNumber(y).10. If Type(x) is either String or Number and Type(y) is Object,11. return the result of the comparison x == ToPrimitive(y).12. If Type(x) is Object and Type(y) is either String or Number,13. *apologies to Gary Bernhardt return the result of the comparison ToPrimitive(x) == y.14. Return false.
  12. 12. === {}
  13. 13. === {}1. Is it the same type?
  14. 14. === {}1. Is it the same type?2. Is the value the same?
  15. 15. === {}1. Is it the same type?2. Is the value the same?* NaN !== NaN
  16. 16. {}"Warning! JSLint will hurt your feelings."
  17. 17. modules
  18. 18. godObject.blah.foo.modulegodObject.blang.other.functionalitygodObject.something.More
  19. 19. A synchronousM oduleD efinition
  20. 20. sugarWater.jsdefine([jquery], function ($) { return function () { $(<strong/>) .text(Ohh yeahh.jpg) .appendTo(body); };});
  21. 21. main.jsrequire([jquery, sugarWater, domReady!], function ($, ohhYeahh) { $(#refreshing) .on(click, ohhYeahh);});
  22. 22. require.js
  23. 23. microjs.com"theres a lib for that"
  24. 24. testing
  25. 25. jasmine
  26. 26. qunit
  27. 27. sinon
  28. 28. DEMO TIME Using TDD, JSLint, and modules,make yet another Twitter search visualization- show me a live stream of tweets with #bcc or @BoiseCodeCamp - highlight presenters
  29. 29. other talks today:Next: Travis Bretton: Server side: Node.js right hereLater: @jarodf: Client side: Backbone.js also right here, 4:30
  30. 30. get the codegithub.com/jasondenizac/bcc12@leJDen

×