jQuery, You & I: Lookin' Good Together
adam j. sontag & Rick Waldron
How People Think jQuery Works
How jQuery Actually Works
There's still a lot you can do if you want to help - and you might just learn a bit in the process.
- There are a lot of jQuery users out there - a lot of them need help!
- The easiest, fastest way to have an impact!
- A great way to get exposure to a diverse set of problems, broaden your familiarity with the API.
- Debug in advance! Learn the solutions to problems before you encounter them yourself.
- Help EVERYBODY at once!
- Existing docs are constantly being improved.
- New features need documentation - learn how they work first!
People Who Make Websites
- Plugins site, learning site, new ThemeRoller...the list goes on
- Designers, backend developers (PHP, Ruby), copy editors... we don't really turn people away!
- 600,000 visits per day!
- Those pages don't just wake up in the morning and serve themselves!
- No, but seriously...
- If server administration is "your thing," we want you you to do your thing!
- Between jQuery and jQuery UI, we've seen nearly 20,000 bugs filed.
- Some of them are critical release blockers...
- Some of them are obscure edge cases...(some that we Won't Fix)
- And some of them are absolute garbage...
Our Bug Tracker Works - You Don't Have To Test It
For more of this fun, come to the "Dramatic Readings of Awesome Tickets" breakout session later
Bug Triage, cont'd
- Separate the wheat from the chaff
- Keep an ear to the ground
- THE ULTIMATE way to force yourself into the guts of jQuery...
- ...and then you can actually start WORKING ON JQUERY CORE!
Everyone else imagines this...
It REALLY is like this
Today, your code might look like this...
Without a style guide, over time it might look like this...
When really, it should look like this...
Open Source, Distributed Development, Remote Teams, etc.
Waste Less Braincycles
Your brain is a parser - optimize code for your brain!
Future you will be glad you did
So follow along! http://gul.ly/l9
What if that mess was actually code...
WTF? So, if obj is not falsy or not typeof object or has a nodeType property or is a window... return false?
Now it wants to check for constructor and prototype.constructor and it might throw an exception?
Um... empty for-in?
If key is undefined? But key was never set to anything...?
How about that awesome horizontal scroll bar?
Be generous with whitespace
We can improve this by commenting with great fervor!
Tell WHY this code does what it does
What can we expect to happen if this code was removed. ( http://gul.ly/d3v )
Quotes... Single? Double?
IT DOESN'T MATTER... Consistency Rules, Ok?!
No, seriously... Don't mix them.
jQuery mandates tabs and double quotes. kthx
Getting back to our code...
When writing Blocks, omitting braces is weird, confusing and criminal
There is also no need to put EVERYTHING in your condition on the same line
Questions, Comments, Rants & Raves
Extreme Negative Commenting http://gul.ly/d3v
jQuery Core Style Guide http://gul.ly/l9
Crockford's Code Conventions http://gul.ly/d3p
@rwaldron & @ajpiano on Twitter/IRC