Slide 1

Slide 1 text

JAVASCRIPT GOLF Terse Coding Challenges @serby http://clock.co.uk WIN A RASPBERRY PI 2

Slide 2

Slide 2 text

PAUL SERBY @serby CTO @clock

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

WE BUILD 
 ENTERPRISE
 DIGITAL PRODUCTS IN JAVASCRIPT

Slide 5

Slide 5 text

TITLE

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

JAVASCRIPT GOLF?

Slide 10

Slide 10 text

JAVASCRIPT GOLF? Produce a given output with a defined input in as few bytes as possible.

Slide 11

Slide 11 text

WHY

Slide 12

Slide 12 text

WHY Has very little real world use

Slide 13

Slide 13 text

WHY Has very little real world use Is often very inefficient

Slide 14

Slide 14 text

WHY Has very little real world use Is often very inefficient Breaks all coding standards

Slide 15

Slide 15 text

WHY Has very little real world use Is often very inefficient Breaks all coding standards Creates unmaintainable code

Slide 16

Slide 16 text

WHY Has very little real world use Is often very inefficient Breaks all coding standards Creates unmaintainable code

Slide 17

Slide 17 text

WHY Has very little real world use Is often very inefficient Breaks all coding standards Creates unmaintainable code Will force you to have a deep understanding of the language

Slide 18

Slide 18 text

WHY Has very little real world use Is often very inefficient Breaks all coding standards Creates unmaintainable code Will force you to have a deep understanding of the language Make you a better coder

Slide 19

Slide 19 text

WHY Has very little real world use Is often very inefficient Breaks all coding standards Creates unmaintainable code Will force you to have a deep understanding of the language Make you a better coder Creative “Necessity is the mother of invention”

Slide 20

Slide 20 text

WHY Has very little real world use Is often very inefficient Breaks all coding standards Creates unmaintainable code Will force you to have a deep understanding of the language Make you a better coder Creative “Necessity is the mother of invention” Fun and addictive

Slide 21

Slide 21 text

WHY Has very little real world use Is often very inefficient Breaks all coding standards Creates unmaintainable code Will force you to have a deep understanding of the language Make you a better coder Creative “Necessity is the mother of invention” Fun and addictive Proves who really is most 1337

Slide 22

Slide 22 text

WHY Has very little real world use Is often very inefficient Breaks all coding standards Creates unmaintainable code Will force you to have a deep understanding of the language Make you a better coder Creative “Necessity is the mother of invention” Fun and addictive Proves who really is most 1337 http://js1k.com/2014-dragons/

Slide 23

Slide 23 text

PRIZES

Slide 24

Slide 24 text

PRIZE

Slide 25

Slide 25 text

LOWEST COMBINED BYTE COUNT WINS!

Slide 26

Slide 26 text

EXAMPLE

Slide 27

Slide 27 text

EXAMPLE Normal

Slide 28

Slide 28 text

EXAMPLE var out = [] for (var i = 0; i <= 30; i++) { out.push(i) } console.log(out) Normal

Slide 29

Slide 29 text

EXAMPLE var out = [] for (var i = 0; i <= 30; i++) { out.push(i) } console.log(out) Normal Terse

Slide 30

Slide 30 text

EXAMPLE var out = [] for (var i = 0; i <= 30; i++) { out.push(i) } console.log(out) out=[];for(i=0;i<31;out[i]=i++) console.log(out) Normal Terse

Slide 31

Slide 31 text

GO! http://javascript-golf.herokuapp.com