70 likes | 226 Views
JavaScript is Awesome!. Also… it’s kinda strange and generally very scary. The WAT talk. [] + [] = "“ [] + {} = [object Object ] {} + [] = 0 {} + {} = NaN Array(16).join(" wat " - 1) + " Batman !“ = NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN Batman!. The highlights. WAT.
E N D
JavaScript is Awesome! Also… it’s kinda strange and generally very scary
The WAT talk • [] + [] = "“ • [] + {} = [object Object] • {} + [] = 0 • {} + {} = NaN • Array(16).join("wat" - 1) + " Batman!“ = • NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN Batman! The highlights
Ok… so JavaScript is a little strange • Then I found this talk: Stop Using Native HTML5! by Kyle Simpson (search it on YouTube) • Here are the good parts
Facades • Wrap native HTML5 APIs in a light Facade • Example-driven development • WRAP ALL THE THINGS! • H5ive on GitHub
But then it got me thinking… What else could we wrap?
Wrap everything • jQuery Ajax • Wrap a server accessor around ajax • Workspeed created a Ajax Queue Manager that does exactly this • Make a better wrapper around browser storage • Workspeed made a wrapper called Adirondack • Like this? storage.save({key: value}, somefunctioncallback) • Use example-driven development • How do you want to write code? • Write it that way and then back-fill a Facade wrapper