Top Banner
Software Horticulture
91

Software Horticulture

Jun 19, 2015

Download

Software

Jieren Chen

Presentation I gave at Nitro about thinking about using analogies to think about software development process.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Software Horticulture

Software Horticulture

Page 2: Software Horticulture

Software Horticultureand other terrible analogies

Page 3: Software Horticulture

What is software engineering?

Page 4: Software Horticulture

What is software engineering?

Coding

Page 5: Software Horticulture

What is software engineering?

Coding

Designing

Page 6: Software Horticulture

What is software engineering?

Coding

Designing

Communicating

Page 7: Software Horticulture

What is software engineering?

Important

Page 8: Software Horticulture

What is software engineering?

Recent

Important

Page 9: Software Horticulture

What is software engineering?

Unique

Recent

Important

Page 10: Software Horticulture

What is software engineering?

Page 11: Software Horticulture

What is software engineering?We use analogies

Page 12: Software Horticulture

What is software engineering?We use analogies

to link to familiar things

Page 13: Software Horticulture

What is software engineering?We use analogies

to link to familiar things

to build intuition

Page 14: Software Horticulture

What is software engineering?We use analogies

to link to familiar things

to build intuition

to frame methodologies

Page 15: Software Horticulture

What is software engineering?But analogies are imperfect

Page 16: Software Horticulture

What is software engineering?But analogies are imperfect

and taking them too far can lead to

incorrect or incomplete conclusions

Page 17: Software Horticulture

What is software engineering?

Page 18: Software Horticulture

What is software engineering?

Build a structure or machine from raw materials

Page 19: Software Horticulture

What is software engineering?

Build a structure or machine from raw materials

Structures need to stay standing

Page 20: Software Horticulture

What is software engineering?

Build a structure or machine from raw materials

Structures need to stay standing

Machines need to work

Page 21: Software Horticulture

What is software engineering?

Page 22: Software Horticulture

What is software engineering?

Heavy on planning and design

Page 23: Software Horticulture

What is software engineering?

Heavy on planning and design

Breaking is permanent and catastrophic

Page 24: Software Horticulture

What is software engineering?

Heavy on planning and design

Breaking is permanent and catastrophic

Requirements are clearly set in advance

Page 25: Software Horticulture

What is software engineering?

It’s for “very serious people.”

Page 26: Software Horticulture

What is software engineering?Requirements

Design

Execution

Verification

Production

Page 27: Software Horticulture

What is software engineering?

This is nothing like how software is built today.

Page 28: Software Horticulture

What is software engineering?

This is nothing like how software is built today.

Too slow and inflexible

Page 29: Software Horticulture

What is software engineering?

This is nothing like how software is built today.

Too slow and inflexible

Can we tolerate failure of any sort?

Page 30: Software Horticulture

What is software engineering?“It is important to say right up front that quality isn't everything, and acknowledging it isn't some sort of moral failing. Value is what you are trying to produce, and quality is only one aspect of it, intermixed with cost, features, and other factors.”

Page 31: Software Horticulture

What is software engineering?“It is important to say right up front that quality isn't everything, and acknowledging it isn't some sort of moral failing. Value is what you are trying to produce, and quality is only one aspect of it, intermixed with cost, features, and other factors.”

Mark Zuckerberg

Page 32: Software Horticulture

What is software engineering?“It is important to say right up front that quality isn't everything, and acknowledging it isn't some sort of moral failing. Value is what you are trying to produce, and quality is only one aspect of it, intermixed with cost, features, and other factors.”

John Carmack

Page 33: Software Horticulture

What is software engineering?

Business demands

Outputs

Page 34: Software Horticulture

Sound familiar?

Page 35: Software Horticulture

What is software economics?

Page 36: Software Horticulture

What is software economics?

Find the right match between

Page 37: Software Horticulture

What is software economics?

Find the right match between

Demand for business logic PMs

Page 38: Software Horticulture

What is software economics?

Find the right match between

Demand for business logic

Supply of business logic

PMs

Devs

Page 39: Software Horticulture

What is software economics?

yes

Page 40: Software Horticulture

What is software economics?

Page 41: Software Horticulture

What is software economics?

Trade offs

Page 42: Software Horticulture

What is software economics?

Trade offs

Time

Page 43: Software Horticulture

What is software economics?

Trade offs

Time

Quality

Scope

Page 44: Software Horticulture

What is software horticulture?

Page 45: Software Horticulture

What is software horticulture?

“If you think about it, building software is more like gardening than building.”

Page 46: Software Horticulture

What is software horticulture?

“If you think about it, building software is more like gardening than building.”

some guy I know

Page 47: Software Horticulture

What is software horticulture?

“If you think about it, building software is more like gardening than building.”

Walter Hilton

Software Architect at Advertising.com

Page 48: Software Horticulture

What is software horticulture?

Page 49: Software Horticulture

What is software horticulture?

Babysitting - safety in both compile and run time

Page 50: Software Horticulture

What is software horticulture?

Babysitting - safety in both compile and run time

Landscaping - encouraging flexibility

Page 51: Software Horticulture

What is software horticulture?

Babysitting - safety in both compile and run time

Landscaping - encouraging flexibility

Linguistics - communication of intent

Page 52: Software Horticulture

What is software babysitting?

What are the two biggest impediments to programming?

Page 53: Software Horticulture

What is software babysitting?

What are the two biggest impediments to programming?

Fear of being wrong

Page 54: Software Horticulture

What is software babysitting?

What are the two biggest impediments to programming?

Fear of being wrong

Being wrong

Page 55: Software Horticulture

What is software babysitting?

Static analysis is a huge safety net

Page 56: Software Horticulture

What is software babysitting?

Static analysis is a huge safety net

Type safety, immutability

Page 57: Software Horticulture

What is software babysitting?

Static analysis is a huge safety net

Type safety, immutability

Use it and use it wisely

Page 58: Software Horticulture

What is software babysitting?

val a = 20val b = if (a == None) {

30} else {

40}

Page 59: Software Horticulture

What is software babysitting?

var a = 1; var b = 0;if (a = 2) {

b += 1} else {

b += 2}

Page 60: Software Horticulture

What is software babysitting?

1. Never use vars

Page 61: Software Horticulture

What is software babysitting?

1. Never use vars

2. Never use AnyVal or Any.

Page 62: Software Horticulture

What is software babysitting?

1. Never use vars

2. Never use AnyVal or Any.

3. Never do Option.get

Page 63: Software Horticulture

What is software babysitting?

1. Never use vars

2. Never use AnyVal or Any.

3. Never do Option.get

4. Be as functional as possible

Page 64: Software Horticulture

What is software babysitting?

Testing is incredibly important

A sieve that catches runtime errors

Page 65: Software Horticulture

What is software babysitting?

Unit testing is for finicky business logic

Functional testing is for sanity checks

Page 66: Software Horticulture

What is software babysitting?

Singletons

Can trap state across application shutdowns

Page 67: Software Horticulture

What is software babysitting?

Singletons

Can trap state across application shutdowns

Use cake pattern for service unit tests

Use reloadable registry for controller functional tests

Page 68: Software Horticulture

What is software landscaping?

Page 69: Software Horticulture

What is software landscaping?

Design for composition

Page 70: Software Horticulture

What is software landscaping?

Design for composition

Would rather have Legos than a BMW

Page 71: Software Horticulture

What is software landscaping?

traits

Page 72: Software Horticulture

What is software landscaping?

traits

type classes

Page 73: Software Horticulture

What is software landscaping?

traits

type classes

first class functions

Page 74: Software Horticulture

What is software landscaping?

trait CanBark; trait HasPawsclass Dog extends CanBark with HasPaws

class Dog extends Canineclass Canine extends Mammal

Page 75: Software Horticulture

What is software landscaping?

trait UserComponenttrait QuestionComponent

object Registryextends UserComponentwith QuestionComponent

Page 76: Software Horticulture

What is software landscaping?

trait Barkable[A]implicit dogIsBarkable = new Barkable[Dog]

def seesBurglar[A](animal: A)(implicit b: Barkable[A])

Page 77: Software Horticulture

What is software landscaping?

case class MyDTO(a: Int, b: String)

object MyDTO {implicit val format: Format[MyDTO] =

Json.format[MyDTO]}

Page 78: Software Horticulture

What is software landscaping?

def withAttack[A](animal: A)(attackF: A => Int): Int

withAttack(myDog) { dog =>dog.attackPoints

}

Page 79: Software Horticulture

What is software landscaping?

myList.map(_ + 1)

Action { implicit request =>Ok(request.body)

}

Page 80: Software Horticulture

What is software linguistics?

Page 81: Software Horticulture

What is software linguistics?

Scala and most modern languages are not designed to communicate with computers

Page 82: Software Horticulture

What is software linguistics?

Scala and most modern languages are not designed to communicate with computers

They are designed to communicate with humans!

Page 83: Software Horticulture

What is software linguistics?

Scala is a huge language.

Page 84: Software Horticulture

What is software linguistics?

Scala is a huge language.

Limit your use of weird paradigms.

Page 85: Software Horticulture

What is software linguistics?

Scala is a huge language.

Limit your use of weird paradigms.

If it is truly useful, teach it to your team

Page 86: Software Horticulture

What is software linguistics?Questions to ask:

Page 87: Software Horticulture

What is software linguistics?Questions to ask:1. What syntax style to use? Dot vs. operator method calls?

Page 88: Software Horticulture

What is software linguistics?Questions to ask:1. What syntax style to use? Dot vs. operator method calls? 2. What semantic style to use? Should use for comprehensions?

Page 89: Software Horticulture

What is software linguistics?Questions to ask:1. What syntax style to use? Dot vs. operator method calls? 2. What semantic style to use? Should use for comprehensions?3. What structures to use? Cake pattern? Actors?

Page 90: Software Horticulture

What is software horticulture?Building software is a steady but constantly changing endeavour to meet product requirements.

Maintaining a codebase is a constant process of grooming, never a complete restructuring.