Simplicity Matters Rich Hickey Simplicity is prerequisite for - - PowerPoint PPT Presentation

simplicity matters
SMART_READER_LITE
LIVE PREVIEW

Simplicity Matters Rich Hickey Simplicity is prerequisite for - - PowerPoint PPT Presentation

Simplicity Matters Rich Hickey Simplicity is prerequisite for reliability Edsger W. Dijkstra Word Origins Simple Easy sim- plex ease < aise < adjacens one fold/braid lie near vs complex vs hard Simple One fold/braid But not


slide-1
SLIDE 1

Simplicity Matters

Rich Hickey

slide-2
SLIDE 2

Simplicity is prerequisite for reliability

Edsger W. Dijkstra

slide-3
SLIDE 3

Word Origins

Simple sim- plex

  • ne fold/braid

vs complex Easy ease < aise < adjacens lie near vs hard

slide-4
SLIDE 4

Simple

One fold/braid One role One task One concept One dimension But not One instance One operation About lack of interleaving, not cardinality Objective

slide-5
SLIDE 5

Easy

Near, at hand

  • n our hard drive, in
  • ur tool set, IDE, apt

get, gem install... Near to our understanding/skill set familiar Near our capabilities Easy is relative

slide-6
SLIDE 6

We can only hope to make reliable those things we can understand We can only consider a few things at a time Intertwined things must be considered together Complexity undermines understanding

Limits

slide-7
SLIDE 7

Change

Do more, Do it differently, Do it better Changes to software require analysis and decisions Your ability to reason about your program is critical More than tests, types, tools, process

slide-8
SLIDE 8

Simplicity = Opportunity

Architectural Agility wins else - push the elephant Design is about pulling things apart Repurpose, substitute, move, combine, extend

slide-9
SLIDE 9

LISP programmers know the value of everything and the cost of nothing.

Alan Perlis

slide-10
SLIDE 10

Programmers know the benefits of everything and the tradeoffs of nothing.

slide-11
SLIDE 11
slide-12
SLIDE 12
slide-13
SLIDE 13

Programmers vs Programs

We focus on ourselves programmer convenience programmer replaceability Rather than the programs software quality, correctness maintenance, change gem install hairball

slide-14
SLIDE 14

Complect

To interleave, entwine, braid Don’t do it! Complecting things is the source of complexity Best to avoid in the first place

slide-15
SLIDE 15

Making Things Easy

Bring to hand by installing getting approved for use Become familiar by learning, trying But mental capability? not going to move very far Make challenges easy by simplifying them

slide-16
SLIDE 16

We can be creating the exact same programs out of significantly simpler components

slide-17
SLIDE 17

What’s in your Toolkit?

Complexity Simplicity State, Objects Values Methods Functions, Namespaces variables Managed refs Inheritance, switch, matching Polymorphism a la carte Syntax Data Imperative loops, fold Set functions Actors Queues ORM Declarative data manipulation Conditionals Rules Inconsistency Consistency

slide-18
SLIDE 18

Simplicity--the art of maximizing the amount

  • f work not done--is essential.

http://agilemanifesto.org/principles.html

slide-19
SLIDE 19

Simplicity is not an objective in art, but one achieves simplicity despite one's self by entering into the real sense of things

Constantin Brancusi

slide-20
SLIDE 20

Lists and Order

A sequence of things Does order matter?

[first-thing second-thing third-thing ...] [depth width height] set[x y z]

  • rder clearly doesn’t matter
slide-21
SLIDE 21

Why Care about Order?

Complects each thing with the next Infects usage points Inhibits change

[name email] -> [name phone email]

“We don’t do that”

slide-22
SLIDE 22

Order in the Wild

Complex Simple Positional arguments Named arguments or map Syntax Data Product types Associative records Imperative programs Declarative programs Prolog Datalog Call chains Queues XML JSON, Clojure literals ...

slide-23
SLIDE 23

Maps (aka hashes), Dammit!

First class associative data structures Idiomatic support literals, accessors, symbolic keys... Generic manipulation Use ‘em

slide-24
SLIDE 24

Information is Simple

Don’t ruin it By hiding it behind a micro-language i.e. a class with information-specific methods thwarts generic data composition ties logic to representation du jour Represent data as data

slide-25
SLIDE 25

Encapsulation

Is for implementation details Information doesn’t have implementation Unless you added it - why? Information will have representation have to pick one

slide-26
SLIDE 26

Wrapping Information

The information class:

IPersonInfo{ getName(); ... verbs and other awfulness ...}

A service based upon it:

IService{ doSomethingUseful(IPersonInfo); ...}

slide-27
SLIDE 27

Can You Move It?

Litmus test - can you move your subsystems?

  • ut of proc, different language, different thread?

Without changing much Not seeking transparency here

slide-28
SLIDE 28

Subsystems Must Have

Well-defined boundaries Abstracted operational interface (verbs) General error handling Take/return data

IPersonInfo - oops!

Again, maps (hashes)

slide-29
SLIDE 29

Simplicity is a Choice

Requires vigilance, sensibilities and care Equating simplicity with ease and familiarity is wrong Develop sensibilities around entanglement Your 'reliability' tools (testing, refactoring, type systems) don't care if program is simple or not Choose simple constructs

slide-30
SLIDE 30

Simplicity Matters

Complexity inhibits understanding and therefor robustness Simplicity enables change It is the primary source of true agility Simplicity = Opportunity Go make (simple) things

slide-31
SLIDE 31

Simplicity is the ultimate sophistication.

Leonardo da Vinci