Incuna at jQuery UK 2013 - part 1

April 20, 2013, 4:21 p.m. in Web Design

Incuna front-end
The jabberwocky was meant to be in the photo, oops

Yesterday my fellow front-end Incunauts and I attended the jQuery UK conference in the lovely city of Oxford (where we are lucky enough to work everyday of course!). White October put on a fantastic Alice in Wonderland themed event complete with jabberwocky t-shirts, jam tarts and even white rabbit pawprints to follow to the location of the event.

It was a great day - socialising with the community, listening to some brilliant talks, and enjoying maybe slightly too much of one of my favourite games of all time - Micro Machines! - in the amazing retro gaming area provided by Replay Events (who I’d never heard of before but now I want them for my birthday party :).

I wanted to get down some of my thoughts on the talks - what I took from them personally (as a front-end developer who’s using jQuery but still working on her fundamental/advanced Javascript understanding), and the ways in which the Incunauts might be able to use some of the new knowledge and advice. I’m going to write this in 2 parts since it got pretty long!

The talks started with the creator of Javascript, Brendan Eich discussing some of the upcoming features of ECMAScript 6. For me, being someone who (as I mentioned above), still has a fairly long way to go with Javascript itself, I can’t say I fully understood all of the code examples that Brendan showed and discussed. But nevertheless, it was interesting to get some background on the JS development that is still going on. The highlight of the talk for me was probably the live example of Unreal Engine 3 (the games engine that runs games like Mass Effect and Gears of war) running in the browser using only Javascript and WebGL. Although I’m very much an "armchair gamer" these days it was very cool to see how far these things have come, and that the possibility to have these kind of games running in a browser is there.

Richard Worth, the director of the jQuery foundation then gave us an overview of the recently released jQuery 2.0, which drops support for IE6,7, and 8 but allows a smaller, faster library for environments where the IE support isn’t needed (or where the code jQuery needs to support IE could actually cause problems). At Incuna we still do often need to support IE8 and on occasions 7, and I think some people (myself included) may have initially thought “this is well and good dropping IE support, but my clients still use IE, don’t I get to use 2.0??” However, jQuery are still continuing to release 1.x versions and have promised that the API will be the same as 2.0 - just without the IE support.

So what I took from this, is that jQuery 2.0 is just another option or branch of jQuery for now - a better option for when you’re doing stuff that you know won’t be used on IE. For us at Incuna I think this will be great to use for when we’re doing things like Phonegap/Cordova apps, allowing us to use a more minimal version of the library without all the unrequired code. But for our websites that need to support IE7/8, we can continue to use 1.9 and 1.x as it gets released, as for the foreseeable future jQuery aren’t getting rid of it, and we’ll be able to use the same API.

A little interesting fact from Richard was that over 50% of websites use jQuery - and actually over 90% of websites with Javascript use jQuery! That's pretty awesome and shows that jQuery is pretty much the go-to library for working with the DOM in Javascript.

Remy Sharp’s talk was, interestingly, about why we shouldn’t always use jQuery. At first I was a bit like, “ahh, this is a jQuery conference, why are you saying use less jQuery, write more Javascript??”. But reading his blog post following the talk, I can see that his point was to not just turn to jQuery by default, and throw the library in as soon as you want to add some Javascript. He pointed out that there are indeed a good number of things that can easily be done with Javascript alone, such as getting the value of an element with .value instead of using the jQuery .val, getting attributes from an element, or simply adding a class. He also mentioned querySelectorAll as a way to select elements from the document without needing jQuery.

I can certainly see why he advises not to just “throw in jQuery” when some of these things can be done simply with Javascript and it’s definitely something I would consider more in the future. However I think the requirements of the project still need to be considered a lot - if you need to support older browsers and the inconsistencies that jQuery deals with in this case, and also if using jQuery is going to allow you to, as the tagline goes, “write less” and “do more”. I think that as much as there is no need to look for jQuery equivalents to things that can be done simply in Javascript, there is equally no need to feel like we should need to write tons of extra Javascript for something that jQuery might deal with well and allow us to spend less time on. In some parts of his talk I did almost get the feeling that he was saying “write more, because if you can do it with Javascript, you should”. But perhaps that’s not what he intended to say, more that we should just consider more if we really need to use it.

Richard Worth mentioned earlier that jQuery is modular now, and if you all you need to do is some document manipulation, you can leave out the rest, making the gzipped version just 10k. Considering the size of an average jpg on our website, I don’t think that the size of jQuery in many cases should be a worry if we do want to use it. But again, I think the whole jQuery vs. Javascript should be considered on the requirements for what you’re trying to do at the time, your project and your client. Overall though, for me coming from the "jQuery first" angle, the talk was definitely helpful to be reminded of/introduced to cases where writing Javascript is almost as simple as writing jQuery and might make more sense.

It was interesting that Remy’s talk was followed by Adam Sontag, whose talk was titled “jQuery is a swiss army knife (and that’s ok!)”. I think Adam’s talk was my favourite of the day, for subject but also his speaking style and the way he discussed the subject. As I tweeted yesterday, it was like a “big warm jquery hug” :) He talked about the way in which jQuery is a multitool/swiss army knife, it has all these parts we can use - and they are there to help us build something, as a tool should. We shouldn’t only use it, but also, it’s there to assist us, so there’s really no reason to dismiss it because it’s a library and think we should build a house with our bare hands for some reason. I think he really strongly disputed the criticism of jQuery and how silly a lot of it is - we’re often blaming a tool for what people do with it. Someone could use a knife to craft something amazing or to stab themselves in the eye - either way, it’s not the tool’s fault, there’s always going to be a spectrum of users, and that’s okay.

Maybe somebody doesn’t fully understand Javascript and is using jQuery, and if that helps them to get things done - great! Not everyone may go from that to try or even want to understand the Javascript behind it, but for others it will give them an entry point and maybe inspire them to learn what’s behind that and make programming more fun. For Adam himself, jQuery was his “gateway drug” into Javascript, and I feel very similarly myself. Adam also mentioned this article - jQuery made me a programmer by Oscar Godson - which I found myself relating to a lot. When you’re not from a programming background it can be tough to learn Javascript from text-heavy programming books. jQuery can show what code can do, make it more exciting and easier to get into, which for people who want to learn Javascript can then provide an easier way to understand what’s going on behind it. We should help and encourage people to learn, and not dismiss or make fun of them for using jQuery as their pathway into programming, if that helps and inspires them.

Adam also gave some useful tips on caching jQuery selections and backed up Remy’s point of not wasting time looking for jQuery equivalents for things you can do in JS. But what I really took from Adam’s talk was renewed inspiration for my own Javascript understanding and the feeling that it’s okay to still be learning, and to learn from jQuery. My favourite quote from him was “Relationships that go beyond code improve code”. This is so true. Different things inspire me personally to want to code and improve my coding - they are things like videogames, visual things, cute things, all the little things that inspire me in life - but one of the main things is people and good relationships, particularly the people I work with everyday at Incuna. Our little front-end team, in particular, is pretty close-knit - we get on great, hang out outside of work sometimes, talk on twitter a lot, and most importantly we support each other and learn from each other when it comes to coding. Our team is a big inspiration to me to keep improving and I guess my point is that no matter the code you learn, it’s super important to have those relationships around that support you and help you improve :)

I’ll leave this here for now, but will discuss the other talks a bit in my next entry along with some useful links that I took away from the conference :) Thanks for reading, and feel free to share your thoughts/comments!