Metaprogramming JavaScript

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

5 comments

Comments 1 - 5 of 5 previous next Post a comment

  • + guest8f1e04 guest8f1e04 5 months ago
    A great introduction to JavaScript at its dynamic best. However, the title was more than a little misleading. The vast and fascinating field of metaprogramming is scarcely hinted at here. Sure, you can use the techniques and patterns outlined here to implement metaprogramming on your own. But that's like making a slideshow explaining what rhyme is and titling it Writing Petrarchan Sonnets.
  • + malteubl malteubl 8 months ago
    Hey, very interesting presentation. You might be interested in Joose, which is a meta object protocol for JS: http://www.slideshare.net/malteubl/joose-javascript-meta-...
  • + guestb4604 guestb4604 9 months ago
    chaudharivilas@ymail.com
  • + jerryemmanuel Jerry Emmanuel 10 months ago
    Cool slides..

    __proto__ is firefox specific for accessing the secret link in objects. Are there any other browser supporting this kind of stuff.??
  • + guest6604d9 guest6604d9 2 years ago
    Nice slide ;)

    http://sanalmedia.blogspot.com/

Post a comment
Embed Video
Edit your comment Cancel

54 Favorites & 3 Groups

Metaprogramming JavaScript - Presentation Transcript

  1. Metaprogramming JavaScript Dan Webb (dan@danwebb.net)
  2. What? “ the writing of computer programs that write or manipulate other programs (or themselves) as their data”
  3. With JavaScript?! ★ Small and fiesty but widely misunderstood ★ Relies on few but powerful constructs ★ You can work with functions, arguments, built-ins types and mechanisms like inheritance at runtime ★ Techniques underpin many JS libraries
  4. JavaScript Exposed: Objects Out Of Control!
  5. Play along!
  6. 4 building blocks
  7. (Nearly) everything is a hash
  8. number string boolean undefined
  9. everything else is an Object
  10. This works with any object
  11. Expandos: a special case
  12. Inspecting objects
  13. Inspecting types
  14. Wha?!
  15. First typeof then instanceof
  16. Functions are Objects
  17. 'Methods' are just functions that are assigned to a property of an object
  18. arguments
  19. Functions can return other functions
  20. Closure
  21. Back to wikipedia... “ A closure occurs when a function is defined within another function, and the inner function refers to local variables of the outer function.
  22. Why is that useful?
  23. Functions can be used to make objects
  24. Constructor functions are just functions
  25. The magic is in the new operator
  26. inheritance
  27. The point is: its all just functions, objects and properties
  28. We can hack it all.
  29. So what can you do with this stuff?
  30. Patch holes in bad implementations
  31. Self optimising code
  32. Pretty APIs
  33. Domain Specific Languages
  34. DOMBuilder http://danwebb.net/lowpro
  35. DIY language features
  36. John Resig's method overloading http://ejohn.org/blog/javascript-method-overloading/
  37. Prototype 1.6 Classes http://prototypejs.org/learn/class-inheritance
  38. and a lot more...
  39. Looking back... ★ JavaScript is small but totally flexible ★ A handful of techniques provide everything you need ★ It's all about objects, properties and functions ★ Don't worry if its not all sunk in. Have a play around. Slides will be available.
  40. Coming Soon...

+ danwrongdanwrong, 2 years ago

custom

24503 views, 54 favs, 33 embeds more stats

As presented at @media Ajax in London on the 20th N more

More Info

© All Rights Reserved

Go to text version
  • Total Views 24503
    • 22205 on SlideShare
    • 2298 from embeds
  • Comments 5
  • Favorites 54
  • Downloads 1048
Most viewed embeds
  • 1646 views on http://www.danwebb.net
  • 401 views on http://www.sitepoint.com
  • 89 views on http://www.coderholic.com
  • 46 views on http://www.mutationevent.com
  • 28 views on http://charlie-blog.com

more

All embeds
  • 1646 views on http://www.danwebb.net
  • 401 views on http://www.sitepoint.com
  • 89 views on http://www.coderholic.com
  • 46 views on http://www.mutationevent.com
  • 28 views on http://charlie-blog.com
  • 24 views on http://www.rolandpoulter.com
  • 9 views on http://static.slideshare.net
  • 5 views on http://www.dowling.me.uk
  • 5 views on http://www.squiz.co.uk
  • 5 views on http://www.netvibes.com
  • 4 views on http://argus.tistory.com
  • 4 views on http://tumble.derbumi.com
  • 4 views on http://www.danwebb.net.sharedcopy.com
  • 3 views on file://
  • 3 views on http://www.charlie-blog.com
  • 2 views on http://rss.sitepoint.com
  • 2 views on http://maidbots.com
  • 2 views on http://eldercarerobot.com
  • 2 views on http://www.filescon.com
  • 1 views on http://64.233.167.104
  • 1 views on http://www.rapidsharefast.com
  • 1 views on http://botsales.com
  • 1 views on http://freewimaxservice.net
  • 1 views on http://s3.amazonaws.com
  • 1 views on http://209.85.129.104
  • 1 views on http://www.thinkingphp.org
  • 1 views on http://cache.baidu.com
  • 1 views on http://rhio.tistory.com
  • 1 views on http://gmodules.com
  • 1 views on http://tumblr.rolandpoulter.com
  • 1 views on http://www.hanrss.com
  • 1 views on http://www.slideshare.net
  • 1 views on http://uptolife.blogspot.com

less

Flagged as inappropriate Flag as inappropriate
Flag as innappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel

Categories