Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/1dFTumJ.
Jarrod Overson presents ways to quantify and reduce JavaScript complexity as well as some of the techniques the experts use to create maintainable JavaScript. Filmed at qconsf.com.
Jarrod Overson has been developing on the web for over 15 years in both startups and global companies and currently works at Riot Games. He founded Gossamer to help bootstrap companies into developing for the modern web and has provided free community training on everything from node to backbone.
2. InfoQ.com: News & Community Site
• 750,000 unique visitors/month
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• News 15-20 / week
• Articles 3-4 / week
• Presentations (videos) 12-15 / week
• Interviews 2-3 / week
• Books 1 / month
Watch the video with slide
synchronization on InfoQ.com!
http://www.infoq.com/presentations
/javascript-complexity
3. Presented at QCon San Francisco
www.qconsf.com
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
8. Immature tooling and IDEs
Wildly variable module styles
Best practices vary as language evolves
Server & Client similar yet so different
JavaScript is Dynamic
all the obvious pitfalls compounded by
9. The Talent Pool is ridic
Closures?
jQuery experts
Web Platform
Engineers
11. Progress is staggering
It’s hard to keep up
The next tech might not be usable yet
When it is, you want to actually
be able to use it
12. Refactoring isn’t easy
Callback hell is more than
just deep nesting
!
IDEs can’t help much, yet
!
But flexibility is more important
on the web than anywhere else
37. Complexity : ? now 3
function main(a) {
if (a > 10) {
!
} else if(a > 5) {
!
}
}
38. Complexity : ? still 3
function main(a) {
if (a > 10) {
!
} else if(a > 5) {
!
} else {
!
}
}
39. Complexity : ? also 3
function main(a) {
if (a > 5) {
if (a > 10) {
!
}
}
}
40. Complexity : 7
function main(a) {
if (a) {
} else if (a) {
}
!
if (other) { }
!
for (var i = 0; i < a; i++) {
if (i % 2) {
} else if (i % 3) {
}
}
}
41. Don’t get hung up on numbers
!
function main() {
/*jshint maxcomplexity:12*/
!
//...
}
!
* note : jshint calculates complexity differently than
complexity-report (plato, grunt-complexity)
56. Code is a liability.
Your job is to provide value with
as little code as possible.
57. How many lines of code does
your main project have right now?
If you don’t know, within 10%,
then you’re ignoring it.
Treat SLOC like credit card debt.
Don’t add to it without knowing the balance.
71. These numbers are for
introspection and exploration
These calculations have been praised and
criticised, promoted and shot down.
(and Halstead died before
being able to defend them)