>

jQuery, You & I: Lookin' Good Together

adam j. sontag & Rick Waldron

How People Think jQuery Works

How jQuery Actually Works

Joining Up

But I'm Not A JavaScript Ninja (Yet)

That's OK!

There's still a lot you can do if you want to help - and you might just learn a bit in the process.

Support

Where?

Documentation

Karl Swedberg - jQuery API Subteam Lead

Where?

People Who Make Websites

Infrastructure

Dan Heberden - Infrastructure Team Lead

Testing Tools

Jörn Zaefferer - Testing Tools Team Lead

Bug Triage

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

Let's Write Stylish Code

Looking back...

Everyone else imagines this...

It REALLY is like this

Contract-Based, Unified-Collaboration

Today, your code might look like this...

Without a style guide, over time it might look like this...

Gross!

When really, it should look like this...

Why?

Encourages Contribution

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

becauseruntogethercodeishardtoread

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?

Tabs? Spaces?

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

Recap.

jQuery.isPlainObject()

WIN!

Questions, Comments, Rants & Raves

Resources

Idiomatic.js http://gul.ly/d3r

Extreme Negative Commenting http://gul.ly/d3v

JSHint http://jshint.com

jQuery Core Style Guide http://gul.ly/l9

Google JavaScript Style Guide http://gul.ly/d3q

Crockford's Code Conventions http://gul.ly/d3p

@rwaldron & @ajpiano on Twitter/IRC

/

#