Slide 1

Slide 1 text

ON SIMPLICITY Futurice WWWeeklies July 3, 2015 @ohanhi

Slide 2

Slide 2 text

–Richard Feldman at MLOC.js 2015 FAMILIARITY GROWS OVER TIME ...but complexity is forever

Slide 3

Slide 3 text

COMPLEXITY • Things to know by heart - language, framework • Things to remember - project • Things to handle when _______

Slide 4

Slide 4 text

SIMPLICITY • Less cognitive load • Less things to go wrong • Focus

Slide 5

Slide 5 text

CODE QUALITY • Code style • Modularity, separation of concerns • Tests • Code reviews • Quick hacks

Slide 6

Slide 6 text

WEB FRONTEND

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

–Brendan Eich at O'Reilly Fluent 2014 JavaScript is like a chainsaw you have in place of a hand

Slide 9

Slide 9 text

–Chris Wilson, http://bendyworks.com/ Mutability is a kind of Chekhov’s gun, it will go off by the third act simply because it is there.

Slide 10

Slide 10 text

WHAT WE DO • Forbid language features - ESLint etc. • Agree on code style - JSCS etc. • Add functional and reactive abstractions - lodash, RxJS… • Switch out the language - Coffee, Clojure, JSX… • Add static types - AtScript, TypeScript, Flow… • Add immutable structures - Immutable.js, mori…

Slide 11

Slide 11 text

→ Transpile to ES5

Slide 12

Slide 12 text

FUNCTIONAL REACTIVE PROGRAMMING • Use immutable structures and global state • Describe what to do in pure functions • Subscribe to streams of input • Handle input safely

Slide 13

Slide 13 text

VISIONS OF THE FUTURE

Slide 14

Slide 14 text

–Jeremy Ashkenas, “Rise of the Transpilers” “Someone is going to unify these three different syntaxes and write a language that just addresses the web-platform directly and it’s going to be insanely popular”

Slide 15

Slide 15 text

http://www.sitepoint.com/future-programming-webassembly-life-after-javascript/ –Eric Elliot

Slide 16

Slide 16 text

ELM

Slide 17

Slide 17 text

• Immutability • Static Types & Records • Functional • Reactive - Signals • Minimal syntax • Compiles to ES5

Slide 18

Slide 18 text

COMPILATION ERRORS http://elm-lang.org/blog/compiler-errors-for-humans

Slide 19

Slide 19 text

–Richard Feldman at MLOC.js I keep having this experience where I make a major breaking refactor, recompile, fix all the compiler errors...and when I bring up Dreamwriter, everything still works! No regressions! This experience makes refactoring SO much fun!

Slide 20

Slide 20 text

RESOURCES Richard Feldman - Shipping a Production Web App in Elm Chris Wilson - Elm for the Frontend, Right Now elm-lang.org - /examples

Slide 21

Slide 21 text

–André Medeiros Ignore the popularity of a solution. Stay close to the Science.

Slide 22

Slide 22 text

Thoughts?