senchacon 2016: javascript is great but stop writing it - rory hardy

21
JavaScript is Great But Stop Writing It

Upload: sencha

Post on 12-Jan-2017

73 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy

JavaScript is GreatBut Stop Writing It

Page 2: SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy

Rory Hardy — @gneatgeek

Page 3: SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy

When Do You Write JavaScript?

Page 4: SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy

JavaScript

$('button') .on('mousedown', function () { this.style.background = '#ccc'; }) .on('mouseup', function () { this.style.background = '#fff'; });

Page 5: SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy

HTML + CSS

<button>Button Text</button> button { background-color: #fff;}button:active { background-color: #ccc;}

Page 6: SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy

Stop Writing JavaScript?

Image Source: www.f-lohmueller.de/

Page 7: SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy

Let's Talk About HTML5

Content

• Form validation

• Audio

• Video

• More

Page 8: SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy

Let's Talk About CSS

Presentation

• Animation

• Transforms

• Flexbox

• More

Image Source: https://mdn.mozillademos.org

Page 9: SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy

NES with CSS?

http://codepen.io/onediv/pen/AsDev

Page 10: SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy

Let's Talk About JavaScript

Behavior and user interactivity

Page 11: SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy

jQuery's Role in DOM Development

• Abstraction of Document Object Model (DOM)

• Not a JavaScript replacement

Page 13: SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy

Writing Better JavaScript

• Learn Vanilla JavaScript

• Read “JavaScript: The Good Parts” by Douglas Crockford

• Leverage available tools

• Leverage libraries/frameworks when they solve your problem

Page 14: SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy

Globals

BOOM!

Plane image source: Mario Paint

Page 16: SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy

Delegation

Image Source: digitalbrandinginstitute.com

Page 17: SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy

Static Analysis (Linter)

for (var i = 0; i < 10; i++) { for (var i = 0; i < 5; i++) { // logic }}

Page 18: SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy

Static Analysis (Linter)

• JSLint

• JSHint

• ESLint

• More

Image Source: memegenerator.net

Page 19: SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy

Tests

Image Source: memegenerator.net

Page 20: SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy

Bootstrap

Image Source: getbootstrap.com

Page 21: SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy

Conclusion

Image Source: imgur.com