#webdevconf WHO IS THIS GUY? Student at the University of Bath Developer for Kainos.com Blogger at javascriptplayground.com (Soon to be) Author of “Beginning jQuery” Twitterer @Jack_Franklin 2 Monday, 22 October 12
#webdevconf to win a digital copy of “Beginning jQuery” tweet your favourite, clean, joke with the hashtag #wdcjack and I’ll pick a favourite at the end of the talk 4 Monday, 22 October 12
#webdevconf DEVELOPERS ARE LAZY and that’s a good thing! sometimes we need to be lazy and let tools do stuff for us and other times we need to get down and dirty with the code 7 Monday, 22 October 12
#webdevconf Better JavaScripting isn’t about those micro-optimisations it’s about writing better JavaScript that will probably be more efficient too 10 Monday, 22 October 12
#webdevconf $(".someDiv").css("color", "blue"); $(".someDiv").attr("title", "hello"); $(".someDiv").text("Hello WDC12"); ...but you do write your JavaScript like this. 12 Monday, 22 October 12
#webdevconf var div = $(".someDiv"); div.chain().stuff().lots(); But I'm bored about talking about this kind of stuff, and I bet you're bored of listening to it. 18 WE KNOW THE BASICS Monday, 22 October 12
#webdevconf so here’s some of the things I think help you write better, more efficient and more maintainable JavaScript (controversial opinions to follow) 20 Monday, 22 October 12
#webdevconf it’s really tricky to break something from the command line start slowly, read tutorials, google when you’re unsure and never just sudo to see if it works 26 Monday, 22 October 12
#webdevconf tools for JS that are CLI only are becoming common Node, npm Grunt, Yeoman, Mocha, Bower these tools save a lot of time and are CLI exclusive 27 Monday, 22 October 12
#webdevconf start organising your JS you split up your CSS into multiple files (even more so with Sass) you split up your JavaScript into multiple files...no? 39 Monday, 22 October 12
#webdevconf make use of script loaders load in scripts asynchronously, in parallel non-blocking, conditional loading Require JS, Yepnope 42 Monday, 22 October 12
#webdevconf next problem is dependency management scripts rely on each other how to manage this to make sure each script has the others it depends on loaded first? 43 Monday, 22 October 12
#webdevconf a great library for this is Require JS it deals with loading your scripts but also with loading them to make sure all scripts that require others are loaded in the correct order 45 Monday, 22 October 12
#webdevconf using Require JS you can also split your code up into modules keep separate functionality separate and modular load these through Require JS allows you to still manage dependencies 46 Monday, 22 October 12
#webdevconf a build tool can compile your Sass/LESS/CoffeeScript/HAML into CSS/JavaScript/HTML and then combine multiple files into one minified version it can also run tests, run code quality checks, and anything else you might need Grunt (gruntjs.com) is particularly awesome in this regard 48 Monday, 22 October 12
#webdevconf TO SUMMARISE either don’t use plugins, or be comfortable editing get to know the command line use libraries & tools like Grunt to do work for you Require JS for script and dependency management build tools because we’re lazy developers 49 Monday, 22 October 12
#webdevconf COMPETITION! you’ve got till the end of Q&A to get your jokes in to win a copy of “Beginning jQuery” hashtag #wdcjack 50 Monday, 22 October 12