Javascript isn't hard

Post on 14-Jan-2017

364 views 0 download

transcript

JavaScript isn’t hard…

Chris Heilmann @codepo8, SmashingConf Barcelona Jam Session, October 2016

Chris Heilmann @codepo8

There is a lot of love for JavaScript on the web…

💚❤💙💛💜

With good reasons…

😃 Very flexible language 😃 Runs everywhere 😃 Automatically available in browsers 😃 Multiple, open-source engines available 😃 Huge community 😃 Lightweight development environment

(text editor/browser is enough?)

Lately JavaScript has a lot of visibility which leads to obsession instead of love…

🔥💵📈💯📢

Which leads to a lot of pressure and anxiety for us developers…

😫😓😭😱😡

Tell me if this sounds familiar…

🤔 I feel like I’m out of the loop 🤔 By the time I get to play with a new JS

feature, people already blog it is “considered harmful”

🤔 Everbody talks about flügelhorn.js but I have no idea what I’d need it for – am I building things nobody else does?

🤔 What are all these NPM modules on my HD?

🤔 Why do I get all these warnings when I build something and how come this is not a problem?

Calm down!

JavaScript used to be easy - it was just one language in the web stack. HTML

(Structure)

CSS (Look and Feel)

JavaScript (Behaviour)

Due to its flexible nature, we extended its use cases massively…

JavaScript now is a lot more…

✅ Web Development ✅ Task runners ✅ Package management ✅ Module-driven development ✅ Extension of software (browsers, editors) ✅ APIs ✅ Services ✅ Servers ✅ Fat client applications ✅ Compilation target ✅ Embeddable runtime ✅ Argument firestarter

Enhance HTML progressively

Use librariesUse APIs and services

Use node, gulp, grunt, NPM and others to manage your tasks and builds

Write code for Node, other systems and services to write apps.

Different uses require different skill levels…

Actively participate in systems used earlier in the timeline…

Participate in extending editors and development environments…

Work on meta languages and ideas to bridge the gap between JS and higher level languages.

Actively participate in inventing the next version of the language

You do not need to do all of that…

You do not need to use all of that…

It’s totally OK to pick and choose what you want and feel comfortable with…

“JavaScript” is not a language, but a whole world of decisions and use cases by now…

Find your place in this world, travel to other destinations, but don’t feel bad for not becoming a resident in all of them…

Make yourself more effective…

Understand what you use and own it…

Ownership and responsibility balancing act

Build tools and process balancing act

Use what enables others to work with

you…

Use what helps you write maintainable

code…

Progressive enhancement balancing act

Control the UX with JavaScript and own

the failure cases.

Rely on the browser to give a “working”

experience.

Supporting the past balancing act…

Use powerful language

additions…

Don’t block out older browsers and

environments…

I can’t help you with all these decisions. It is up to you and the products you work on what makes sense and what doesn’t…

However, here’s a few pointers…

🤓 Learn the language - learn how it works, its strengths and weaknesses.

😉 Use polyfills and libraries when you know what they do. Make sure you can remove them and upgrade them if needed.

😍 ES6 is the current, ratified version of JavaScript. Use it, don’t wait for it.

🤓 Promises are an important part of every new JavaScript API. Good to get your head around them.

😱 Don’t panic! It’s a buffet, not a main course. Pick what doesn’t make you sick.

CHRIS HEILMANN

@CODEPO8

CHRISTIANHEILMANN.COM

THANKS!