software horticulture
DESCRIPTION
Presentation I gave at Nitro about thinking about using analogies to think about software development process.TRANSCRIPT
Software Horticulture
Software Horticultureand other terrible analogies
What is software engineering?
What is software engineering?
Coding
What is software engineering?
Coding
Designing
What is software engineering?
Coding
Designing
Communicating
What is software engineering?
Important
What is software engineering?
Recent
Important
What is software engineering?
Unique
Recent
Important
What is software engineering?
What is software engineering?We use analogies
What is software engineering?We use analogies
to link to familiar things
What is software engineering?We use analogies
to link to familiar things
to build intuition
What is software engineering?We use analogies
to link to familiar things
to build intuition
to frame methodologies
What is software engineering?But analogies are imperfect
What is software engineering?But analogies are imperfect
and taking them too far can lead to
incorrect or incomplete conclusions
What is software engineering?
What is software engineering?
Build a structure or machine from raw materials
What is software engineering?
Build a structure or machine from raw materials
Structures need to stay standing
What is software engineering?
Build a structure or machine from raw materials
Structures need to stay standing
Machines need to work
What is software engineering?
What is software engineering?
Heavy on planning and design
What is software engineering?
Heavy on planning and design
Breaking is permanent and catastrophic
What is software engineering?
Heavy on planning and design
Breaking is permanent and catastrophic
Requirements are clearly set in advance
What is software engineering?
It’s for “very serious people.”
What is software engineering?Requirements
Design
Execution
Verification
Production
What is software engineering?
This is nothing like how software is built today.
What is software engineering?
This is nothing like how software is built today.
Too slow and inflexible
What is software engineering?
This is nothing like how software is built today.
Too slow and inflexible
Can we tolerate failure of any sort?
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.”
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
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
What is software engineering?
Business demands
Outputs
Sound familiar?
What is software economics?
What is software economics?
Find the right match between
What is software economics?
Find the right match between
Demand for business logic PMs
What is software economics?
Find the right match between
Demand for business logic
Supply of business logic
PMs
Devs
What is software economics?
yes
What is software economics?
What is software economics?
Trade offs
What is software economics?
Trade offs
Time
What is software economics?
Trade offs
Time
Quality
Scope
What is software horticulture?
What is software horticulture?
“If you think about it, building software is more like gardening than building.”
What is software horticulture?
“If you think about it, building software is more like gardening than building.”
some guy I know
What is software horticulture?
“If you think about it, building software is more like gardening than building.”
Walter Hilton
Software Architect at Advertising.com
What is software horticulture?
What is software horticulture?
Babysitting - safety in both compile and run time
What is software horticulture?
Babysitting - safety in both compile and run time
Landscaping - encouraging flexibility
What is software horticulture?
Babysitting - safety in both compile and run time
Landscaping - encouraging flexibility
Linguistics - communication of intent
What is software babysitting?
What are the two biggest impediments to programming?
What is software babysitting?
What are the two biggest impediments to programming?
Fear of being wrong
What is software babysitting?
What are the two biggest impediments to programming?
Fear of being wrong
Being wrong
What is software babysitting?
Static analysis is a huge safety net
What is software babysitting?
Static analysis is a huge safety net
Type safety, immutability
What is software babysitting?
Static analysis is a huge safety net
Type safety, immutability
Use it and use it wisely
What is software babysitting?
val a = 20val b = if (a == None) {
30} else {
40}
What is software babysitting?
var a = 1; var b = 0;if (a = 2) {
b += 1} else {
b += 2}
What is software babysitting?
1. Never use vars
What is software babysitting?
1. Never use vars
2. Never use AnyVal or Any.
What is software babysitting?
1. Never use vars
2. Never use AnyVal or Any.
3. Never do Option.get
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
What is software babysitting?
Testing is incredibly important
A sieve that catches runtime errors
What is software babysitting?
Unit testing is for finicky business logic
Functional testing is for sanity checks
What is software babysitting?
Singletons
Can trap state across application shutdowns
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
What is software landscaping?
What is software landscaping?
Design for composition
What is software landscaping?
Design for composition
Would rather have Legos than a BMW
What is software landscaping?
traits
What is software landscaping?
traits
type classes
What is software landscaping?
traits
type classes
first class functions
What is software landscaping?
trait CanBark; trait HasPawsclass Dog extends CanBark with HasPaws
class Dog extends Canineclass Canine extends Mammal
What is software landscaping?
trait UserComponenttrait QuestionComponent
object Registryextends UserComponentwith QuestionComponent
What is software landscaping?
trait Barkable[A]implicit dogIsBarkable = new Barkable[Dog]
def seesBurglar[A](animal: A)(implicit b: Barkable[A])
What is software landscaping?
case class MyDTO(a: Int, b: String)
object MyDTO {implicit val format: Format[MyDTO] =
Json.format[MyDTO]}
What is software landscaping?
def withAttack[A](animal: A)(attackF: A => Int): Int
withAttack(myDog) { dog =>dog.attackPoints
}
What is software landscaping?
myList.map(_ + 1)
Action { implicit request =>Ok(request.body)
}
What is software linguistics?
What is software linguistics?
Scala and most modern languages are not designed to communicate with computers
What is software linguistics?
Scala and most modern languages are not designed to communicate with computers
They are designed to communicate with humans!
What is software linguistics?
Scala is a huge language.
What is software linguistics?
Scala is a huge language.
Limit your use of weird paradigms.
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
What is software linguistics?Questions to ask:
What is software linguistics?Questions to ask:1. What syntax style to use? Dot vs. operator method calls?
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?
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?
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.