a call to js developers - let’s stop trying to impress each other and start building

97
Call to JavaScript developers: Let’s stop trying to impress each other and start building Chris Heilmann @codepo8, Web on the Edge, Helsinki, Nov 2015

Upload: christian-heilmann

Post on 16-Apr-2017

2.975 views

Category:

Software


0 download

TRANSCRIPT

Page 1: A call to JS Developers - Let’s stop trying to impress each other and start building

Call to JavaScript developers: Let’s stop trying to impress each other and start building

Chris Heilmann @codepo8, Web on the Edge, Helsinki, Nov 2015

Page 2: A call to JS Developers - Let’s stop trying to impress each other and start building

Moore’s Law: (paraphrased)

Computers get faster, better, cheaper and are more available every two years.

Page 3: A call to JS Developers - Let’s stop trying to impress each other and start building

May’s Law: (paraphrased)

Software efficiency halves every 18 months, compensating Moore’s law.

Page 4: A call to JS Developers - Let’s stop trying to impress each other and start building

https://www.flickr.com/photos/56218409@N03/19216130670

WE MOVE FAST AND RUN IN CIRCLES

Page 5: A call to JS Developers - Let’s stop trying to impress each other and start building

We’re all about the Moore…

Page 6: A call to JS Developers - Let’s stop trying to impress each other and start building

WE WORK WITH AMAZING HARDWARE…

Page 7: A call to JS Developers - Let’s stop trying to impress each other and start building

WE WORK WITH GREAT CONNECTIVITY…

Page 8: A call to JS Developers - Let’s stop trying to impress each other and start building

WE GET PAID WELL – FOR A JOB WE LIKE

https://www.flickr.com/photos/31317832@N05/4326186183

Page 9: A call to JS Developers - Let’s stop trying to impress each other and start building

WE WORK WITH AMAZING BROWSERS

Page 10: A call to JS Developers - Let’s stop trying to impress each other and start building

BROWSERS THAT GIVE OUR USERS FUNCTIONALITY WE DON’T EVER USE BUT THEY APPRECIATE…

Page 11: A call to JS Developers - Let’s stop trying to impress each other and start building

BROWSER DO AN INCREDIBLE AMOUNT OF WORK FOR US…

• Display of all kind of media content • Fix minor mistakes in our code • Optimise our code to run smoothly • Provide us with developer tools • Provide us with deep insights what

our code does to the computer • Allow us to automate testing in

them and debug remotely on devices we don’t even own (using 3rd party services)

Page 12: A call to JS Developers - Let’s stop trying to impress each other and start building

So how come we made the web all about May’s law?

Page 13: A call to JS Developers - Let’s stop trying to impress each other and start building

CONVENIENCE BREEDS MORE CONVENIENCE

• Browsers aren’t good enough • Development environments are not

predictive and do our work for us • Languages are confusing • We should have to write less code

and achieve more

Instead of celebrating how lucky we are, we complain…

Page 14: A call to JS Developers - Let’s stop trying to impress each other and start building

https://www.flickr.com/photos/38497891@N04/4151566643

WE LIVE IN A HYPE FUELLED ENVIRONMENT

Page 15: A call to JS Developers - Let’s stop trying to impress each other and start building

WE KEEP PROJECTING…

US OUR AUDIENCE

TECHNICAL PROFICIENCY, INTEREST IN CHANGE AND UPGRADES, INTEREST IN SPENDING MONEY ON THE WEB FOR WEB SERVICES…

Page 16: A call to JS Developers - Let’s stop trying to impress each other and start building

OR, ACTUALLY…

US OUR AUDIENCE

TECHNICAL PROFICIENCY, INTEREST IN CHANGE AND UPGRADES, INTEREST IN SPENDING MONEY ON THE WEB FOR WEB SERVICES…

Page 17: A call to JS Developers - Let’s stop trying to impress each other and start building

🐴💩

Page 18: A call to JS Developers - Let’s stop trying to impress each other and start building

TIME TO GET REAL…

USOUR

ASSUMED AUDIENCE

OUR AUDIENCE

TECHNICAL PROFICIENCY, INTEREST IN CHANGE AND UPGRADES, INTEREST IN SPENDING MONEY ON THE WEB FOR WEB SERVICES…

Page 19: A call to JS Developers - Let’s stop trying to impress each other and start building

THE WEB IS AN AMAZING IDEA AND OFFER…

• Access to information world-wide, 24⨉7

• Independent of hardware, software, ability, or geographical location

• A read/write medium, everybody is invited to become a creator and not just a consumer

Page 20: A call to JS Developers - Let’s stop trying to impress each other and start building

ONE PERSON’S BEAUTY IS ANOTHER ONE’S WORRY…

• It is hard to build software and interfaces for the unknown

• Open distribution, caching and availability of source code is anathema to content providers wanting to protect their content.

Page 21: A call to JS Developers - Let’s stop trying to impress each other and start building

THE NEXT USERS ARE NOT THOSE WHO COMPLAIN THE WEB IS NOT AS GOOD AS NATIVE APPS…

https://vimeo.com/139312920

https://brucelawson.github.io/talks/2015/velocity

Bruce Lawson at SOTB 2015

Page 22: A call to JS Developers - Let’s stop trying to impress each other and start building

THE NEXT CHALLENGE IS NOT IN COFFEE SHOPS IN THE SILICON VALLEY…

Page 23: A call to JS Developers - Let’s stop trying to impress each other and start building

AS DEVELOPERS, WE ARE ASKED TO DO THE IMPOSSIBLE…

• Make it work the same in every browser

• Make it easy to maintain and we want to control everything

• Make sure it is also accessible - I think there’s a law we need to follow

• Don’t spent too much time on it - let’s release it now and fix it later!

• Use this analytics code you have no clue about - we need to know how people use our products

Page 24: A call to JS Developers - Let’s stop trying to impress each other and start building

THE ANSWER IS ALWAYS JAVASCRIPT

• Javascript is too powerful for its own good.

• Almost everything that goes wrong can be controlled and to a degree fixed with JavaScript

• This leads to people relying on libraries and frameworks

Page 25: A call to JS Developers - Let’s stop trying to impress each other and start building

WHAT DOES THIS CODE DO?

Page 26: A call to JS Developers - Let’s stop trying to impress each other and start building

https://www.flickr.com/photos/73645804@N00/2473052504

JUST FIND THE RIGHT BRICKS AND ASSEMBLE SOMETHING GREAT!

Page 27: A call to JS Developers - Let’s stop trying to impress each other and start building

https://www.flickr.com/photos/27429206@N02/4290544535

THE AMAZING TECH OF TODAY IS THE RUBBISH OF TOMORROW…

Page 28: A call to JS Developers - Let’s stop trying to impress each other and start building

I CURRENTLY WORK WITH A CLEANUP CREW…

http://dev.modern.ie/tools/staticscan/

https://github.com/MicrosoftEdge/static-code-scan

Page 29: A call to JS Developers - Let’s stop trying to impress each other and start building

A simple way to detect how old a part of our massive site is checking which version of jQuery was used in that part of it. It’s like rings in a tree trunk.

https://www.flickr.com/photos/91183364@N08/13916636762

Page 30: A call to JS Developers - Let’s stop trying to impress each other and start building

WE BREAK THE WEB FOR THE SAKE OF DEVELOPER CONVENIENCE…

Page 31: A call to JS Developers - Let’s stop trying to impress each other and start building

WE’RE GOING FULL SPEED ON INNOVATION…

• Componentised Web • Extensible Web Manifesto • WebGL • WebAssembly/ASM.js • PostCSS • Progressive Apps

Page 32: A call to JS Developers - Let’s stop trying to impress each other and start building
Page 33: A call to JS Developers - Let’s stop trying to impress each other and start building

THE VICIOUS INNOVATION CYCLE…

Page 34: A call to JS Developers - Let’s stop trying to impress each other and start building

NSFW

Page 35: A call to JS Developers - Let’s stop trying to impress each other and start building

https://www.flickr.com/photos/56844027@N05/5634567317

WE SHOULD WORRY A LOT MORE ABOUT COST…

Page 36: A call to JS Developers - Let’s stop trying to impress each other and start building

WE USE CODE WE DON’T UNDERSTAND TO FIX ISSUES WE DON’T HAVE…

• Learning libraries and frameworks beyond “hello world” costs time and money.

• Time you don’t spend on looking at optimising your code

• In essence, we value developer convenience over user experience.

Page 37: A call to JS Developers - Let’s stop trying to impress each other and start building

DEVELOPER CONVENIENCE, PRODUCTIVITY & EFFICIENCY…

#FFD700

Page 38: A call to JS Developers - Let’s stop trying to impress each other and start building

COST FOR DEVELOPERS…

• Learning new frameworks • Re-learning frameworks • Cutting down on possible hires/

adding to onboarding time • Debugging frameworks • Setting up developer

environments

Page 39: A call to JS Developers - Let’s stop trying to impress each other and start building
Page 40: A call to JS Developers - Let’s stop trying to impress each other and start building

IS DEPENDENCY HELL A PROBLEM OF THE TOO PRIVILEGED?

https://www.youtube.com/watch?v=PA139CERNbc

Stephan Bönnemann (JSConfEU 2015): Dependency Hell Just Froze Over

Page 41: A call to JS Developers - Let’s stop trying to impress each other and start building

WAITING FOR NPM TO FINISH INSTALLING…

Page 42: A call to JS Developers - Let’s stop trying to impress each other and start building

THE REAL IMPORTANT BIT IS THE COST FOR OUR USERS…

• Time to load / execute • Bandwidth used • CPU usage • Frame rate (60 fps) • Memory usage • Battery

Page 43: A call to JS Developers - Let’s stop trying to impress each other and start building

CONTROL OVER WHAT IS HAPPENING IN THE BROWSER

#FFD700

Page 44: A call to JS Developers - Let’s stop trying to impress each other and start building

REPLACING BUILT-IN FUNCTIONALITY FOR THE SAKE OF CONTROL…

Page 45: A call to JS Developers - Let’s stop trying to impress each other and start building

IF WE BUILD CLIENT-SIDE SOLUTIONS WE DON’T CONTROL WHERE OUR CODE RUNS.

Page 46: A call to JS Developers - Let’s stop trying to impress each other and start building

HOMEWORK / SNEAK PREVIEW OF GREAT INSIGHTS…

PAUL LEWIS @AEROTWIST

Page 47: A call to JS Developers - Let’s stop trying to impress each other and start building

THE DOM IS SLOW?

Page 48: A call to JS Developers - Let’s stop trying to impress each other and start building
Page 49: A call to JS Developers - Let’s stop trying to impress each other and start building
Page 50: A call to JS Developers - Let’s stop trying to impress each other and start building
Page 51: A call to JS Developers - Let’s stop trying to impress each other and start building

ANALYSING BROWSER RESULTS…

npm install -g bigrig github.com/GoogleChrome/big-rig github.com/GoogleChrome/node-big-rig

Page 52: A call to JS Developers - Let’s stop trying to impress each other and start building
Page 53: A call to JS Developers - Let’s stop trying to impress each other and start building

THE JAVASCRIPT LEARNING PROCESS HAS ALWAYS BEEN INTERESTING…

• Use view source to see what others are doing…

• Copy and paste the bits that look like they are responsible for some things

• Change some numbers around • Run into errors • Blame Internet Explorer

Page 54: A call to JS Developers - Let’s stop trying to impress each other and start building

THIS, OF COURSE, WAS WRONG AND WE GOT MORE PROFESSIONAL…

• Search for a solution on Stackoverflow

• Copy and paste the bits that look like they are responsible for some things

• Change some numbers around • Run into errors • Blame JavaScript for being

terrible and not a real language • For good measure, blame

Internet Explorer.

Page 55: A call to JS Developers - Let’s stop trying to impress each other and start building

WE ARE RUNNING OUT OF BOTH EXCUSES…

Page 56: A call to JS Developers - Let’s stop trying to impress each other and start building

1997 20151998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015

1997ECMAScript1

1998ECMAScript2

1999ECMAScript3

2005 - 2007ECMAScript4 - Abandoned

2009ECMAScript5

2015ECMAScript6

JAVASCRIPT EVOLVES…

Page 57: A call to JS Developers - Let’s stop trying to impress each other and start building

1997 20151998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015

1997ECMAScript1

1998ECMAScript2

1999ECMAScript3

2005 - 2007ECMAScript4 - Abandoned

2009ECMAScript5

2015ECMAScript6

JAVASCRIPT GREW UP…

• 5+ years since ES5 ratification • Significant changes in 15+ years • Backwards compatible • Ratified June 2015

http://www.ecma-international.org/publications/standards/Ecma-262.htm

Page 58: A call to JS Developers - Let’s stop trying to impress each other and start building

SUPPORT IS ENCOURAGING (EDGE, FIREFOX, CHROME, SAFARI (ON 9))

http://kangax.github.io/compat-table/es6/

Page 59: A call to JS Developers - Let’s stop trying to impress each other and start building

NUMBERS! Current status (December 2015):

Desktop: Edge 13: 84% Firefox 44: 74% Chrome 48/Opera 35: 65% Safari 9: 54% (former 21%!)

Mobile: Android 5.1: 29% iOS9: 54%

http://kangax.github.io/compat-table/es6/

Page 60: A call to JS Developers - Let’s stop trying to impress each other and start building

WITH ES6 WE HAVE A CLEAN NEW SLATE…

Page 61: A call to JS Developers - Let’s stop trying to impress each other and start building

this IS COMPLICATED *** ***

Page 62: A call to JS Developers - Let’s stop trying to impress each other and start building

this IS COMPLICATED

*** ***

blog.getify.com/arrow-this/

Page 63: A call to JS Developers - Let’s stop trying to impress each other and start building

this IS COMPLICATED

*** ***

blog.getify.com/arrow-this/

Page 64: A call to JS Developers - Let’s stop trying to impress each other and start building

this IS COMPLICATED

*** ***

blog.getify.com/arrow-this/

Page 65: A call to JS Developers - Let’s stop trying to impress each other and start building

this IS COMPLICATED

*** ***

blog.getify.com/arrow-this/

Page 66: A call to JS Developers - Let’s stop trying to impress each other and start building

SAVING KEYSTROKES

Page 67: A call to JS Developers - Let’s stop trying to impress each other and start building

BURN THE WITCH!

http://www.bennadel.com/blog/2949-var-for-life---why-let-and-const-don-t-interest-me-in-javascript.htm

Page 68: A call to JS Developers - Let’s stop trying to impress each other and start building

https://maxwellito.github.io/es6-quiz-slides

ES2015 QUIZ TIME…

Page 69: A call to JS Developers - Let’s stop trying to impress each other and start building

https://maxwellito.github.io/es6-quiz-slides

ES2015 QUIZ TIME…

Page 70: A call to JS Developers - Let’s stop trying to impress each other and start building

https://maxwellito.github.io/es6-quiz-slides

ES2015 QUIZ TIME…

Page 71: A call to JS Developers - Let’s stop trying to impress each other and start building

https://maxwellito.github.io/es6-quiz-slides

ES2015 QUIZ TIME…

Page 72: A call to JS Developers - Let’s stop trying to impress each other and start building

ES2015 QUIZ TIME…

Page 73: A call to JS Developers - Let’s stop trying to impress each other and start building

UTF-8, BABY…

Page 74: A call to JS Developers - Let’s stop trying to impress each other and start building

THE NEW BASELINE IS HERE!

Page 75: A call to JS Developers - Let’s stop trying to impress each other and start building

THE NEW BASELINE IS HERE!

Page 76: A call to JS Developers - Let’s stop trying to impress each other and start building

MAYBE IT IS PRUDENT TO CALM THE F… DOWN A BIT!

Page 77: A call to JS Developers - Let’s stop trying to impress each other and start building

FREE TIME PROJECTS USED TO BE ABOUT FUN AND EXPERIMENTATION…

http://sephie-monster.deviantart.com/art/Mythbusters-153616339

Page 78: A call to JS Developers - Let’s stop trying to impress each other and start building

NOT ABOUT CUTTHROAT COMPETITION AND SELF-INFLICTED COMPLEXITY…

https://egghead.io/series/how-to-write-an-open-source-javascript-library

Page 79: A call to JS Developers - Let’s stop trying to impress each other and start building

Library Builders

map, set & weakmap__proto__ProxiesSymbols

Sub7classable built7ins

Scalable Apps

let, const & block7scoped bindings

ClassesPromisesIterators

GeneratorsTyped arrays

Modules

Syntactic Sugar

Arrow functionsEnhanced object literals

Template stringsDestructuring

Rest, Spread, DefaultString, Math, Number, Object, RegExp APIs

JAVASCRIPT CATERS TO DIFFERENT AUDIENCES…

Page 80: A call to JS Developers - Let’s stop trying to impress each other and start building

https://www.flickr.com/photos/48066826@N02/5034289376

TIME TO CALM DOWN AND CONCENTRATE ON THE GOOD THINGS…

Page 81: A call to JS Developers - Let’s stop trying to impress each other and start building

BETTER BROWSERS ALLOW US TO WRITE SIMPLER HELPER LIBRARIES…

http://lea.verou.me/2015/12/introducing-bliss-a-3kb-library-for-happier-vanilla-js/

Page 82: A call to JS Developers - Let’s stop trying to impress each other and start building

COMPATIBILITY IS ON EVERY BROWSER MAKER’S RADAR…

Page 83: A call to JS Developers - Let’s stop trying to impress each other and start building

MONOPOLIES FALL AND SURPRISES HAPPEN…

Page 84: A call to JS Developers - Let’s stop trying to impress each other and start building

ES6 GOODNESS FOR EVERYBODY!

https://blogs.windows.com/msedgedev/2015/12/05/open-source-chakra-core/

Page 85: A call to JS Developers - Let’s stop trying to impress each other and start building

• Open Source and cross platform • Written in JavaScript • Includes debugging and linting -

learn your mistakes while you write code

• GitHub integration

VISUAL STUDIO CODE

https://code.visualstudio.com/

Page 86: A call to JS Developers - Let’s stop trying to impress each other and start building

TRANSPILATING FOR THE WEB OF YESTERDAY…

https://babeljs.io• Converts ES6 to older versions on the server or the client • In use by Facebook and many others • Used in editors and tool chains

Page 87: A call to JS Developers - Let’s stop trying to impress each other and start building

https://featuretests.io/

FEATURE TESTING WHAT YOU NEED…

Page 88: A call to JS Developers - Let’s stop trying to impress each other and start building

EXCELLENT RESOURCES ARE FREE AND ONLINE…

https://ponyfoo.com/articles/es6

Page 89: A call to JS Developers - Let’s stop trying to impress each other and start building

READ THE EXCELLENT BOOK EXPLORING ES6 FOR FREE (OR BUY IT, AXEL DESERVES SUPPORT)

http://exploringjs.com/es6/

Page 90: A call to JS Developers - Let’s stop trying to impress each other and start building

• One hour free test server • Authenticate with Google,

Facebook or Microsoft • Keep your code by forking or

downloading it

TRY NODE AND EXPRESS…

https://www.christianheilmann.com/2015/10/27/testing-out-node-and-express-without-a-local-install-or-editor/

Page 91: A call to JS Developers - Let’s stop trying to impress each other and start building

EVERYBODY DUCK!LIVE DEMO…

Page 92: A call to JS Developers - Let’s stop trying to impress each other and start building

PLEASE, GO AND MAKE A BETTER WEB!

• Analyse the speed of your products and improve it by simplifying them: webpagetest.org

• Stop trying to guess what browser is in use and assume unknown browsers to be good, not terrible.

• Keep up to date with what browsers can do: caniuse.com and use it!

• File bugs, report issues, talk to us!

Page 93: A call to JS Developers - Let’s stop trying to impress each other and start building

JAVASCRIPT IS STILL THE SIMPLEST, MOST VERSATILE AND INVITING LANGUAGE OUT THERE…

Page 94: A call to JS Developers - Let’s stop trying to impress each other and start building

LET’S TALK MORE HUMAN

https://github.com/HugoGiraudel/SJSJ

Page 95: A call to JS Developers - Let’s stop trying to impress each other and start building

YOU MAKE THE WEB, LET US HEAR WHAT YOU NEED…

Page 96: A call to JS Developers - Let’s stop trying to impress each other and start building
Page 97: A call to JS Developers - Let’s stop trying to impress each other and start building

THANKS! CHRIS HEILMANN

@CODEPO8

CHRISTIANHEILMANN.COM