javascript is awesome! also… it’s kinda strange and generally very scary
TRANSCRIPT
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
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
FacadesWrap 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 everythingjQuery 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