Simplicity in Practice https://xkcd.com/1349/ Words, words, words. - - PowerPoint PPT Presentation

simplicity in practice https xkcd com 1349 words words
SMART_READER_LITE
LIVE PREVIEW

Simplicity in Practice https://xkcd.com/1349/ Words, words, words. - - PowerPoint PPT Presentation

Simplicity in Practice https://xkcd.com/1349/ Words, words, words. Hamlet, Act 2 Scene 2 simple, adj. one fold/braid one role, task, concept, dimension antonym: complex, interleaved, of many parts objective measure


slide-1
SLIDE 1

Simplicity in Practice

slide-2
SLIDE 2

https://xkcd.com/1349/

slide-3
SLIDE 3

– Hamlet, Act 2 Scene 2

“Words, words, words.”

slide-4
SLIDE 4

simple, adj.

  • one fold/braid
  • one role, task, concept, dimension
  • antonym: complex, interleaved, of many parts
  • objective measure
slide-5
SLIDE 5

easy, adj.

  • near at hand
  • familiar
  • antonym: hard, requiring effort
  • relative measure
slide-6
SLIDE 6

Simplicity Understanding Changability Debuggability Longterm Dev Speed Reliability Testability

slide-7
SLIDE 7

Ease Understanding Changability Testability

??? ??? ???

Shortterm Dev Speed

slide-8
SLIDE 8

(< easy simple)

slide-9
SLIDE 9

simplicity is necessary simplicity isn’t sufficient

slide-10
SLIDE 10
slide-11
SLIDE 11
slide-12
SLIDE 12

a small example

slide-13
SLIDE 13

– Wise Opinionated Clojure Programmers

“Never define global, stateful vars”

slide-14
SLIDE 14
  • complects:
  • namespaces with runtime application state
  • compilation with app initialization

easy

(def uri "datomic:dev://localhost:4334/my-db") (def conn (d/connect uri))

slide-15
SLIDE 15

“What do I do instead?” “Just create a single object representing your application’s state, which you construct explicitly at initialization time and pass around to the rest of your program”

slide-16
SLIDE 16
slide-17
SLIDE 17

(defrecord DB [uri] component/Lifecycle (start [:config] (d/connect uri))) (defn system [config] (component/system-map :config config :db (->DB (-> config :db :uri))))

https://github.com/stuartsierra/component

slide-18
SLIDE 18
slide-19
SLIDE 19

–Bruce Eckel, 2009

“We're writers.”

slide-20
SLIDE 20

code

  • functions
  • data
  • execution flow

stories

  • setting
  • characters
  • plot
slide-21
SLIDE 21

interest clarity comprehension collaboration

slide-22
SLIDE 22
slide-23
SLIDE 23

revisiting terms

slide-24
SLIDE 24

f (easy,simple)

slide-25
SLIDE 25

– Rich Hickey, Simple Made Easy

slide-26
SLIDE 26

simplicity ease

slide-27
SLIDE 27

simplicity ease

slide-28
SLIDE 28

easy

simple

?

slide-29
SLIDE 29

easy

simple

wieldy

slide-30
SLIDE 30

wieldy, adj.

  • capable of easily ‘wielding’ one's body or limbs, or

a weapon, etc.; vigorous, active, agile, nimble.

  • easily wielded, controlled, or handled;

manageable; handy.

  • requiring strength to wield, heavy or bulky; wielded

with force, powerful. formal definition

Oxford English Dictionary

slide-31
SLIDE 31

wieldy, adj.

  • manageable, handy, powerful
  • easy ∩ simple
  • pertaining to developer experience
  • powerful and fun
  • relational measure

programmer definition

slide-32
SLIDE 32
  • flexibility
  • codebase size
  • development speed
  • developer morale
  • developer improvement

benefits

slide-33
SLIDE 33
slide-34
SLIDE 34

–George Frideric Handel

“I should be sorry if I

  • nly entertained

them, I wish to make them better.”

slide-35
SLIDE 35

Wieldy Code

Good Programmer

slide-36
SLIDE 36

simple, unwieldy

[{:db/id #db/id[:db.part/db] :db/ident :artist/name :db/valueType :db.type/string :db/cardinality :db.cardinality/one :db/fulltext true :db/index true :db/doc "The artist's name" :db.install/_attribute :db.part/db} {:db/id #db/id[:db.part/db] :db/ident :artist/country :db/valueType :db.type/ref :db/cardinality :db.cardinality/one :db/doc "The artist's country of origin" :db.install/_attribute :db.part/db}]

slide-37
SLIDE 37

easy, unwieldy

(jdbc/with-connection db (jdbc/insert-records :language_authors {:first_name "Rich" :last_name "Hickey"} {:first_name "Larry" :last_name "Wall"}))

slide-38
SLIDE 38

recontextualization

  • To reinterpret or refresh (an idea, work of art, etc.)

by placing it in a new or different context.

slide-39
SLIDE 39

three kinds of documentation

slide-40
SLIDE 40

reference simple tutorial easy conceptual wieldy

slide-41
SLIDE 41

reference style

  • terse
  • complete
  • no context
slide-42
SLIDE 42

tutorial style

  • task-oriented
  • longform
  • concepts are doled out
  • n demand
slide-43
SLIDE 43

conceptual style

  • 1. problem statement
  • 2. concepts
  • 3. common usage examples
  • 4. pointers to reference documentation
  • 5. roughly 1 page

i.e. telling the story

slide-44
SLIDE 44

so I know a new word what now?