from nasa to startups to big commerce

208
FROM NASA TO STARTUPS TO BIG COMMERCE Building Maintainable, Scalable Projects DANIEL GREENFELD

Post on 15-Sep-2014

16 views

Category:

Documents


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: From NASA to Startups to Big Commerce

FROM NASA TO STARTUPS TO BIG COMMERCEBuilding Maintainable, Scalable Projects

DANIEL GREENFELD

Page 2: From NASA to Startups to Big Commerce

SUCCESS!!!SUCCESS!!!SUCCESS!!!SUCCESS!!!

Page 3: From NASA to Startups to Big Commerce

FAILURE.

Page 4: From NASA to Startups to Big Commerce

Let’s get

started

Page 5: From NASA to Startups to Big Commerce

I ❤ aerospace

(you’ve been warned)

Page 6: From NASA to Startups to Big Commerce

BIGPLANS

Page 7: From NASA to Startups to Big Commerce

http://en.wikipedia.org/wiki/Soyuz_(spacecraft)

Page 8: From NASA to Startups to Big Commerce

The Reality

Page 9: From NASA to Startups to Big Commerce

http://en.wikipedia.org/wiki/Conestoga_(rocket)

ConestegaFirst

commercial rocket!

1996!

Page 10: From NASA to Startups to Big Commerce

https://www.flickr.com/photos/archer10/2215343914/

Page 11: From NASA to Startups to Big Commerce

https://www.flickr.com/photos/ramcguire/19953122

Page 12: From NASA to Startups to Big Commerce

Early Design Mistakes

Page 13: From NASA to Startups to Big Commerce

Early Design Mistakes

• Not understanding or knowing the requirements

• Over or under architecting

• Choosing the wrong tools

• Premature Optimization

• Management fiat made with ignorance or bad data

Page 14: From NASA to Startups to Big Commerce

Technical

Debt

Page 15: From NASA to Startups to Big Commerce

Loan Against the Future

• Get it done fast!

• Grouping data poorly

• Hardcoding

• Upcoming technology will fix it

• Leave testing and documentation for later

Technical Debt

Page 16: From NASA to Startups to Big Commerce

Hard to Maintain Enhance Scale Projects

Page 17: From NASA to Startups to Big Commerce
Page 18: From NASA to Startups to Big Commerce

2006

Page 19: From NASA to Startups to Big Commerce

http://science.nasa.gov

More NASA work

Page 20: From NASA to Startups to Big Commerce

Get It Done!!!

https://www.djangopackages.com/

Page 21: From NASA to Startups to Big Commerce

Bad Practices@ PyCon 2011

https://www.flickr.com/photos/pydanny/5670716870/

Page 22: From NASA to Startups to Big Commerce

Had mistakes at start

Page 23: From NASA to Startups to Big Commerce

We insisted on rebuildReje

cted

Page 24: From NASA to Startups to Big Commerce

Rebuilt and works great

Page 25: From NASA to Startups to Big Commerce

Electronic Giftcards

Page 26: From NASA to Startups to Big Commerce

Epic Volume

Page 27: From NASA to Startups to Big Commerce

Our Challenge

Page 28: From NASA to Startups to Big Commerce

Refactor

Page 29: From NASA to Startups to Big Commerce

SUCCESS!!!SUCCESS!!!SUCCESS!!!

Page 30: From NASA to Startups to Big Commerce

Challenges

Page 31: From NASA to Startups to Big Commerce

Great Engineering Team

Page 32: From NASA to Startups to Big Commerce

Scaling?

Page 33: From NASA to Startups to Big Commerce
Page 34: From NASA to Startups to Big Commerce

no-name projects

can go

viral

But even

Page 35: From NASA to Startups to Big Commerce

So Many Things to Get Wrong

Page 36: From NASA to Startups to Big Commerce

is a constant

Failure

Page 37: From NASA to Startups to Big Commerce

But that’s okay

Page 38: From NASA to Startups to Big Commerce

How Do We Build for the

Future?

Page 39: From NASA to Startups to Big Commerce

Starting a Project

Page 40: From NASA to Startups to Big Commerce

Greenfield Projects

http://commons.wikimedia.org/wiki/File:A_Green_field_in_the_countryside_-_geograph.org.uk_-_193455.jpg

Page 41: From NASA to Startups to Big Commerce

Greenfield Projects

Or Greenfeld Projects?

Page 42: From NASA to Startups to Big Commerce

Greenfield Projectshttp://commons.wikimedia.org/wiki/File:Green_fields_in_Gramado.jpg

Page 43: From NASA to Startups to Big Commerce

Starting Basics

Page 44: From NASA to Startups to Big Commerce

Kelly JohnsonReknowned and prolific aircraft design engineer

Invented Seriously Awesome Planes!!!

Page 45: From NASA to Startups to Big Commerce

P-38 Lightning

http://en.wikipedia.org/wiki/Lockheed_P-38_Lightning#mediaviewer/File:Lockheed_P-38J_Lightning_-_1.jpg

Page 46: From NASA to Startups to Big Commerce

U-2

http://commons.wikimedia.org/wiki/File:Usaf.u2.750pix.jpg

Page 47: From NASA to Startups to Big Commerce

SR-71

http://commons.wikimedia.org/wiki/File:Lockheed_SR-71_Blackbird.jpg

Page 48: From NASA to Startups to Big Commerce

Kelly JohnsonReknowned and prolific aircraft design engineer

AREA 51

Invented Seriously Awesome Planes!!!

Page 49: From NASA to Startups to Big Commerce

Kelly JohnsonReknowned and prolific aircraft design engineer

AREA 51

Invented Seriously Awesome Planes!!!

Really Good Manager

Page 50: From NASA to Startups to Big Commerce

Keep It Simple, Stupid

Kelly Johnson Said:

Page 51: From NASA to Startups to Big Commerce

KISS

Kelly Johnson Said:

Keep It Simple, Stupid

Page 52: From NASA to Startups to Big Commerce

Keep it Simple Stupid

Keep It Simple, Stupid

KISS

Kelly Johnson Said:

Page 53: From NASA to Startups to Big Commerce

Keep it Simple Stupid

If Kelly Johnson kept it simple,

why can’t we?

Page 54: From NASA to Startups to Big Commerce

Simple != Simplistic

Page 55: From NASA to Startups to Big Commerce

Needless Complexity

is Bad

Page 56: From NASA to Startups to Big Commerce

Bad ComplexitySwap two position values in a list

Page 57: From NASA to Startups to Big Commerce

Simplicity is a VirtueFoundations: Simple

But not Simplistic

Feature Construction: Simple

Bug Fixes: Simple

Page 58: From NASA to Startups to Big Commerce

Be careful with databases that make simplistic approaches easy.

JSON => SQL

Page 59: From NASA to Startups to Big Commerce

Pro-Tip:

Keep management of data relations out of the code!

Page 60: From NASA to Startups to Big Commerce

http://en.wikipedia.org/wiki/File:Map_of_USA_with_state_names_2.svg

http://upload.wikimedia.org/wikipedia/commons/thumb/b/b2/CourtGavel.JPG/600px-CourtGavel.JPG

http://commons.wikimedia.org/wiki/File:Benz-velo.jpg

Page 61: From NASA to Startups to Big Commerce

Reasons to consider Non-Relational Databases

• Ephemeral Data (caching)

• Hierarchical Data

• Other data structures that don’t easily map to relations

• Seating charts (Eventbrite!)

• Organization charts in dysfunctional companies

Page 62: From NASA to Startups to Big Commerce

Pro-TipWould it work in a spreadsheet?

relational databaseYES!

No! non-relational database

Page 63: From NASA to Startups to Big Commerce

Simplicity isn’t always the answer

Page 64: From NASA to Startups to Big Commerce

Sometimes you do need complexity

Page 65: From NASA to Startups to Big Commerce

Right at the Beginning

Page 66: From NASA to Startups to Big Commerce

Valid Reason for Complexity:

Database Transactions

Transactions aren’t complex, but engineers often think they are.Note:

Page 67: From NASA to Startups to Big Commerce

http://commons.wikimedia.org/wiki/File:WinonaSavingsBankVault.JPG

Page 68: From NASA to Startups to Big Commerce

http://commons.wikimedia.org/wiki/File:Okayama_Red_Cross_Hospital.jpg

Page 69: From NASA to Startups to Big Commerce

Database transactions protect

finances and

lives

Valid Cause of Complexity

Page 70: From NASA to Startups to Big Commerce

transactionsIf one operation fails,

revertrevertrevert

Page 71: From NASA to Startups to Big Commerce

Don’t code solutions to handle

transactions

Page 72: From NASA to Startups to Big Commerce

Use databases with transactions

PostgreSQL MySQL

Page 73: From NASA to Startups to Big Commerce

Avoiding Database Transactions is Simplistic

You have to build special workarounds to make things reliable

Page 74: From NASA to Startups to Big Commerce

You have to build special workarounds to make things reliable

Avoiding Database Transactions is Simplistic

Page 75: From NASA to Startups to Big Commerce

You have to build special workarounds to make things reliable

Avoiding Database Transactions is Simplistic

Page 76: From NASA to Startups to Big Commerce

Is a simplistic approach to avoid complexity…

A) Bad Design Decision? !

B) Technical Debt?

Page 77: From NASA to Startups to Big Commerce

Answer

• Plan to fix later?

• Otherwise:

Technical DebtBad Design Decision?

Page 78: From NASA to Startups to Big Commerce

More Thoughts

on Complexity

Page 79: From NASA to Startups to Big Commerce

Complex Foundations: Harder to maintain

Page 80: From NASA to Startups to Big Commerce

Complexity2=

Complex Foundations

Complex Business+

Page 81: From NASA to Startups to Big Commerce

Complexity2=

Hard to Debug

Hard to Enhance+

Page 82: From NASA to Startups to Big Commerce

Complex Code Causes Edge Cases

• Are you testing all the BRANCH (if/switch) statements?

• How do you test that ‘brilliant’ class heirarchy?

Page 83: From NASA to Startups to Big Commerce

Your business logic is going to be enough complexity

Building finance project?

Spend your time making it make money?

Fighting the project’s design?

Page 84: From NASA to Startups to Big Commerce

Don’t Get Fancy• Build a solid foundation first.

• “prototype” projects often aren’t.

• Beware virality

• No money

• Fancy stuff can come later.

Page 85: From NASA to Startups to Big Commerce

Choosing Tools

Page 86: From NASA to Startups to Big Commerce

Choosing Tools is

HardHardHard

Page 87: From NASA to Startups to Big Commerce
Page 88: From NASA to Startups to Big Commerce

Do it the Right Way

Page 89: From NASA to Startups to Big Commerce

Management Fiat

Page 90: From NASA to Startups to Big Commerce

Don’t Use Management Fiat

with ignorance or bad data

Page 91: From NASA to Startups to Big Commerce

Mistake: Management FiatChoosing Enterprise Software

because it’s expensive

Page 92: From NASA to Startups to Big Commerce

Your engineer’s recommendations !

!

!

!

!

vs

Expensive White Papers written by well-paid mostly non-technical analysts that

either state the obvious, expensive, or non-sensical

Mistake: Management Fiat

Page 93: From NASA to Startups to Big Commerce

HIPAAHealth Insurance and

Accountability Act

Mistake: Management FiatWrong advice for

Page 94: From NASA to Startups to Big Commerce

Your engineer’s recommendations

vs

Anything in a business management

magazine.

Mistake: Management Fiat

Page 95: From NASA to Startups to Big Commerce

Salesperson’

vsThat person you just met who might

possibly has a vested financial interest in what they are recommending.

Your engineer’s recommendations

Mistake: Management Fiat

Page 96: From NASA to Startups to Big Commerce

Your engineer’s recommendations when they constantly tell you how smart they are.

!vs

Burning your money in a fire.

Same result, but faster

Mistake: Management Fiat

http://commons.wikimedia.org/wiki/File:Burning-money-and-yuanbao-at-the-cemetery-3249.JPG

Page 97: From NASA to Startups to Big Commerce

Your engineer’s recommendations when they want to continue using a 10+ year old legacy platform

vs

The Bus Factor

Mistake: Management Fiat

http://en.wikipedia.org/wiki/File:GMBus.jpg

Page 98: From NASA to Startups to Big Commerce

http://en.wikipedia.org/wiki/Bus_factorBus Factor!

http://commons.wikimedia.org/wiki/File:Arriva_T6_nearside.JPG

Page 99: From NASA to Startups to Big Commerce
Page 100: From NASA to Startups to Big Commerce

Is documented?

Does the job?

Has traction?

Choosing tools

Page 101: From NASA to Startups to Big Commerce

• Ignore corporate marketing hype

• Even for corporate open source projects

• Unless…

Choosing tools

It’s software for popular proprietary hardware

Page 102: From NASA to Startups to Big Commerce

Toolkit Ecosystems

Page 103: From NASA to Startups to Big Commerce

Is there an Ecosystem?

• Python, Django, Flask, et al

• Python package Index

• Django Packages

• Language + Framework means lots of optimized packages already exist to do much of the work.

Tools with traction have extendable components

Page 104: From NASA to Startups to Big Commerce

Case Study:

Page 105: From NASA to Startups to Big Commerce

5000+ for Django

46000+ for Python

Page 106: From NASA to Startups to Big Commerce

Parallels

78K+

83K+

Page 107: From NASA to Startups to Big Commerce

Don’t Reinvent the Wheel

http://commons.wikimedia.org/wiki/File:London-Eye-2009.JPG

Page 108: From NASA to Startups to Big Commerce

Example: CMSDon’t build your own!

Page 109: From NASA to Startups to Big Commerce

Unless your project is about reinventing wheels

http://commons.wikimedia.org/wiki/File:Triple_Rotacaster_commercial_industrial_omni_wheel.jpg

Page 110: From NASA to Startups to Big Commerce

Pro-Tip #1Toolkit Ecosystems and Engineers

If engineers don’t know that tool ecosystems exist, consider them junior.

http://commons.wikimedia.org/wiki/File:Fawnpuppy.jpg

Page 111: From NASA to Startups to Big Commerce

Educate them!

Page 112: From NASA to Startups to Big Commerce

Pro-Tip #2Toolkit Ecosystems and Engineers

If engineers refuse to work with an ecosystem, !

don’t waste your time with them.

Page 113: From NASA to Startups to Big Commerce

They purposefully lower the Bus Factor

http://commons.wikimedia.org/wiki/File:Keiseibus-twinbus-20071013.jpg

Page 114: From NASA to Startups to Big Commerce

Best Practices

Page 115: From NASA to Startups to Big Commerce

Insist on Best Practices

Page 116: From NASA to Startups to Big Commerce

Cleaner Consistent Stronger Elegant CODE

Page 117: From NASA to Startups to Big Commerce

Easier to Debug

Page 118: From NASA to Startups to Big Commerce

Easier to Add Features

Page 119: From NASA to Startups to Big Commerce

New Staff Ramp Up

FasterFasterFaster

Page 120: From NASA to Startups to Big Commerce

How to Best PracticeResearch and find the common consensus

PEP-8

PEP-20

Example: Python

Page 121: From NASA to Startups to Big Commerce

Find ReferencesResearch and find the common consensus

Page 122: From NASA to Startups to Big Commerce

Research and find the common consensus

Find References

Page 123: From NASA to Startups to Big Commerce

Research and find the common consensus

• MySQL

• PostgreSQL

• MongoDB

• Redis

• CouchDB

• Cassandra

• BigTable

Find References

Page 124: From NASA to Startups to Big Commerce

Management Pro-Tip Part 1

If your engineers consistently refuse to follow defined best practices…

Page 125: From NASA to Startups to Big Commerce

They purposefully lower the Bus Factor

http://commons.wikimedia.org/wiki/File:B43OleBillatIWMLondon.jpg

Page 126: From NASA to Startups to Big Commerce

Management Pro-Tip Part 2

Get new ones

Page 127: From NASA to Startups to Big Commerce

Tests

Page 128: From NASA to Startups to Big Commerce

Always have them!

Even some coverage is better than no coverage.

Page 129: From NASA to Startups to Big Commerce

Always have a working test harness

And a few tests that check really obvious things.

Page 130: From NASA to Startups to Big Commerce

Tests on existing projects without test harnesses

seleniumhq.org

Page 131: From NASA to Startups to Big Commerce

Add a test for every bug fix.

Page 132: From NASA to Startups to Big Commerce

Every Programming Tool has Test Harnesses

Page 133: From NASA to Startups to Big Commerce

Management Pro-Tip

Engineers who consistently refuse to write tests lower their bus factor to 1.

Prepare to keep them forever

http://commons.wikimedia.org/wiki/File:Ride_On_5312_at_Glenmont.jpg

Page 134: From NASA to Startups to Big Commerce

Version Control

Works on every operating system

Tutorials and books everywhere

Just start with it or add it

We have no excuses not to use it!

Page 135: From NASA to Startups to Big Commerce

Version Control Pro-Tips

Page 136: From NASA to Startups to Big Commerce

Pro-Tip #1

Dropbox is NOT software-project-acceptable

version control!

Page 137: From NASA to Startups to Big Commerce

Pro-Tip #2

An FTP server for backing up files isn’t either

Page 138: From NASA to Startups to Big Commerce

Pro-Tip #3

Most good engineers won’t work on a project that doesn’t

have version control

Page 139: From NASA to Startups to Big Commerce

Pro-Tip #4

Most good engineers won’t work at companies

without version control

Page 140: From NASA to Startups to Big Commerce

Scaling

Page 141: From NASA to Startups to Big Commerce

Scaling usually isn’t a problem

Page 142: From NASA to Startups to Big Commerce

97% ChanceYou Ain’t Gonna Need it

Page 143: From NASA to Startups to Big Commerce

A 3% Case

“Register here”

http://commons.wikimedia.org/wiki/File:President_Barack_Obama.jpg

Page 144: From NASA to Startups to Big Commerce
Page 145: From NASA to Startups to Big Commerce

Other 3% CasesA major celebrity tweets about your project

You are launching the official site for a blockbuster movie

You just go viral

Page 146: From NASA to Startups to Big Commerce
Page 147: From NASA to Startups to Big Commerce

What if your foundations are bad?

Page 148: From NASA to Startups to Big Commerce

Bad Foundations

are Fixable

W. Lloyd MacKenzie, via Flickr @ http://www.flickr.com/photos/saffron_blaze/

With enough engineers, money, and headaches, you can fix anything

Page 149: From NASA to Startups to Big Commerce
Page 150: From NASA to Startups to Big Commerce

Two Quick Scaling Fixes

Based on the fact that the early scaling problems are almost always database-related.

Page 151: From NASA to Startups to Big Commerce

It’s almost always about the data

Page 152: From NASA to Startups to Big Commerce

First Fix: Caching

The first healthcare.gov patch implemented by their tiger team

added caching.

Page 153: From NASA to Startups to Big Commerce

Second Fix: Indexing

Almost every datastore supports indexes.

Apply them to places with the most data reads.

Page 154: From NASA to Startups to Big Commerce

The Big Scaling Mistake

to Avoid

Page 155: From NASA to Startups to Big Commerce

Switching Tools Too Early

• Changing to the unusual datastore de-jour

• Trying a new programming language

• Switching out template languages.

• Changing Application Frameworks

before attempting to improve the database

Page 156: From NASA to Startups to Big Commerce

Careful of the hypeReplacing Tools

mobile site

Went from Rails to Node.js. Giant Improvements!

!(A coincidence, perhaps?)

Page 157: From NASA to Startups to Big Commerce

Node.js was just part of the story

They also modernized servers and added more.

Replacing ToolsCareful of the hype

Page 158: From NASA to Startups to Big Commerce

Replacing FrameworksBut recognize excitement

Clearly Linkedin Engineers were excited to work with Node.js

Engineer interest in tools is important. It inspires us to do great things.

Page 159: From NASA to Startups to Big Commerce

Management Pro-Tip

Uninspired Engineers don’t do the best work and are much more prone to leave.

Page 160: From NASA to Startups to Big Commerce

Don’t Optimize Prematurely

Page 161: From NASA to Startups to Big Commerce

Instead…

Page 162: From NASA to Startups to Big Commerce

Follow Best Practices

Page 163: From NASA to Startups to Big Commerce

By following best practices, you are laying a foundation that

makes scaling a project easier.

Page 164: From NASA to Startups to Big Commerce

Long Term Scaling Fixes

Page 165: From NASA to Startups to Big Commerce

Add More Servers

Page 166: From NASA to Startups to Big Commerce

DevOps!

Page 167: From NASA to Startups to Big Commerce

DevOps!Ansible

Puppet

Chef

Docker

Salt Stack

Page 168: From NASA to Startups to Big Commerce

DevOps!

Catch: Devops != Cheap

Ansible

PuppetChef

Docker

Salt Stack

Page 169: From NASA to Startups to Big Commerce

Pro-TipUndocumented DevOps lowers the bus factor of operations staff.

Prepare to keep them forever

http://commons.wikimedia.org/wiki/File:E85bus.jpg

Page 170: From NASA to Startups to Big Commerce

Software as a Service

Heroku

Engineyard Google App Engine

Firebase

Various AWS Products

Page 171: From NASA to Startups to Big Commerce

Gets Expensive

Software as a Service

Page 172: From NASA to Startups to Big Commerce

Vendor Lock-In

Software as a Service

Page 173: From NASA to Startups to Big Commerce

How to replace tools safely

Page 174: From NASA to Startups to Big Commerce

Don’t switch all at once!

Version 4

Page 175: From NASA to Startups to Big Commerce

Language Switches

Identify bottlenecks in the code

Try applying new language there.

Page 176: From NASA to Startups to Big Commerce

Example Switches

Aim for giant speed boosts

• Numpy

• Scipy

• Pandas

Move slow big data/scientific calculations to:

Page 177: From NASA to Startups to Big Commerce

More Example Switches

Port components to compiled languages such as:

• PyPy

• Go

• C

• Java

Aim for giant speed boosts

Page 178: From NASA to Startups to Big Commerce

Maintenance Over Time

Page 179: From NASA to Startups to Big Commerce

Case Study: Every Project

• Your project has been around for a while

• Problems

• Fixing bugs is hard

• Adding features is hard

Page 180: From NASA to Startups to Big Commerce

Why is it harder?• Project is no longer the bright and shiny

• Adding features adds to complexity

• Bugs caused by unforeseen edge cases

• Not enough tests make catching developer introduced bugs harder

• Mistakes at the beginning are really starting to show

Original Engineer(s) was an Idiot

Page 181: From NASA to Startups to Big Commerce

Original Engineer(s) are always idiots

Page 182: From NASA to Startups to Big Commerce

I’ve yet to join a project where I didn’t feel like

ranting all the time

Page 183: From NASA to Startups to Big Commerce

Rant Time!• Why use a relational database?

• Why not use a non-relational database?

• Why this programming language?

• Why not use OO or functional programming techniques?

• Why use OO or functional programming techniques?

• What the heck is this programming pattern anyway?

Page 184: From NASA to Startups to Big Commerce

Caveat: The Constant of the Worst Code

Ever

Page 185: From NASA to Startups to Big Commerce

Hindsight is 20/20

• No one predicts with 100% accuracy

• Not on software projects

• It’s easy with hindsight for us to complain about the decisions made.

Page 186: From NASA to Startups to Big Commerce

Reality Check

• Making accurate predictions is hard

• Projects grow organically

• At least you are getting paid to work on this, right?

Page 187: From NASA to Startups to Big Commerce

Be Understanding

• Don’t be a jerk.!

• Try to understand why things evolved the way they did.

• Forgive your predecessor

• They can provide useful information!

• Circumstances can and will be reversed

Page 188: From NASA to Startups to Big Commerce

Maintenance Over Time

Page 189: From NASA to Startups to Big Commerce

Why is it harder?• Project is no longer the bright and shiny

• Adding features adds to complexity

• Bugs caused by unforeseen edge cases

• Not enough tests make catching developer introduced bugs harder

• Mistakes at the beginning are really starting to show

Original Engineer(s) was an IdiotHOW DO WE FIX THIS?

Page 190: From NASA to Startups to Big Commerce

The Basics

Maintenance Over Time

Page 191: From NASA to Startups to Big Commerce

The BasicsMake engineer setup and system config as fast/easy as possible

Vagrant DockerChef

PuppetAnsible

Salt Stack

Page 192: From NASA to Startups to Big Commerce

More Basics: TestsNo more code changes without tests.

New code releases must maintain test coverage or increase it.

Page 193: From NASA to Startups to Big Commerce

More Basics: Document!

Document everything as you come across it

Markdown, RestructuredText, Google Docs, even Wikis

Don’t use Word or Pages!

Page 194: From NASA to Startups to Big Commerce

Refactor Mercilessly

Once the basics are in place…

Page 195: From NASA to Startups to Big Commerce

Reward Successful Refactoring

Page 196: From NASA to Startups to Big Commerce

Give them a gnome!

Courtesy Daniel Roy Greenfeld

Page 197: From NASA to Startups to Big Commerce

Code Reduction Gnome

Courtesy Daniel Roy Greenfeld

Page 198: From NASA to Startups to Big Commerce

New code must follow best practices

Basic: Follow Best Practices

Page 199: From NASA to Startups to Big Commerce

Bug-fixed code might be moved to best practices

Page 200: From NASA to Startups to Big Commerce

Embrace Code

Reuse

Page 201: From NASA to Startups to Big Commerce

3+ Identical Lines of Code in the same place?

Page 202: From NASA to Startups to Big Commerce

Stick it in a function or method!

Page 203: From NASA to Startups to Big Commerce

Write a test for that function or method!

Page 204: From NASA to Startups to Big Commerce

Any place this function or method is used…

Write a test!

Page 205: From NASA to Startups to Big Commerce

Release Early and Often

• Rather than do massive updates periodically

• Do incremental releases constantly

• Users respond more favorably

• Bug management is easier

Page 206: From NASA to Startups to Big Commerce

Use Feature Flags• Turn new features off and on as needed

• Libraries can help you

• Use it for A/B testing

• In use at Eventbrite and others

Page 207: From NASA to Startups to Big Commerce

http://en.wikipedia.org/wiki/Falcon_9

Summary

Page 208: From NASA to Startups to Big Commerce

pydanny.com

Engineer at

Co-Author of

Architecture Team