Pro Yearly is on sale from $80 to $50! »

Software Gardening

Software Gardening

Developing software is not like constructing a building. Software is more organic and should be treated as a garden. This presentation takes several gardening concepts and applies them to software development.


Craig Berntson

July 17, 2018


  1. Software Gardening Craig Berntson

  2. Today’s Agenda The problem of the definition Three basic needs

    Getting our hands dirty Caring for our garden Harvesting Using the right tools
  3. The Problem Of The Definition

  4. Build Architecture Engineer Design Architect Scaffolding Contractor Plan Tear Down

  5. Rules & regulations Months of planning Fixed blueprints Exact outcome

    Changes difficult
  6. Architect Contractor Heat Water Sewer Electric Foundation Framing Roof Permits

  7. Construction projects use waterfall project management

  8. Code Bloat Rotting Code Rewrites Spaghetti Code Bugs Dissatisfied Customers

    Technical Debt
  9. Rather than construction, software is more like gardening – it

    is more organic than concrete. - Pragmatic Programmer
  10. ▪ Having an organization similar in its complexity to that

    of living things ▪ Characterized by the systematic arrangement of parts; organized; systematic ▪ Developing in a manner analogous to the natural growth and evolution characteristic of living organisms; arising as a natural outgrowth -
  11. Nurturing Pruning Fertilizing Planting Weeding Soil Seeds Light Water Tools

  12. Three Basic Needs

  13. SOIL

  14. Agile Project Management Individuals and Interactions Working Software Customer Collaboration

    Responding to Change
  15. WATER

  16. Software Craftsmanship Well-Crafted Software Steadily Adding Value Community Of Professionals

    Productive Partnerships
  17. LIGHT

  18. Professional Development Podcasts

  19. Getting Our Hands Dirty

  20. Seeds

  21. OOP Principles Basic OOP Inheritance Polymorphism Encapsulation Loose coupling Tight

    cohesion DRY YAGNI SOLID OOP Single Responsibility Open/Closed Liskov Substitution Interface Segregation Dependency Inversion
  22. Insecticide

  23. Problems With… if switch for foreach while do…while null +,

    -, *, /
  24. Unit Testing Test While Developing (TWD) Test Driven Development (TDD)

  25. In 1976, G.J. Meyers described a 100-line program that had

    1018 unique paths. In 1979 he described a much simpler program. It was just a loop and a few if statements. In most languages, you could write it in 20 lines of code. This program has 100 trillion paths. – Testing Computer Software, Cem Kaner
  26. Pruning

  27. Clear cut Selective cutting Thinning Replanting

  28. Refactoring It is not rewriting It is reorganizing without changing

    behavior Improves maintainability and extensibility
  29. None
  30. Smells are certain structures in the code that indicate violation

    of fundamental design principles and negatively impact design quality. - Martin Fowler
  31. Application-level Smells • Duplicated code • Contrived complexity Class-level Smells

    • Large class • Cyclomatic complexity • Excessive use of literals Method-level smells • Too many parameters • Too many optional parameters or nulls • Long method
  32. “When and Why Your Code Starts to Smell Bad” 2015

    – College of William and Mary 1. Most of the time, smells are introduced when code is originally written 2. Maintenance and evolution smells are characterized by peculiar metrics trends 3. Refactoring itself can introduce new smells 4. Developers with high workloads and release pressure are more likely to introduce smells'15-BadSmells-CRC.pdf

  34. Design Patterns

  35. Create Patterns • Factory • Singleton Structural Patterns • Adapter

    • Facade • Decorator Behavioral Patterns • Chain of Responsibility • Strategy • Template
  36. Weeding

  37. Version Control Don’t comment old code. Remove it! Small change-sets

    Check-in often
  38. Caring for Our Garden

  39. Nurturing

  40. Continuous Integration Build and test code with every commit Fail

    fast / Learn early Reduce risk Increase quality Enable better project visibility Reduce repetitive or manual processes
  41. Harvesting

  42. Software Delivery Pipeline Auto Deploy Manual Testing Automated Testing Continuous

  43. Using the Right Tools

  44. Tools

  45. Development Tools • Visual Studio • VS Code • .NET

    Framework • .NET Core Other Tools • Fiddler • LinqPad • Database • Pluralsight • VS Add-ons • VS Extensions Technologies • Restful Web Services • Microservices
  46. Wrap-up

  47. Agile Software craftsmanship Professional development SOLID Unit testing Refactoring Design

    patterns Version control Continuous Integration Software delivery pipeline Tools
  48. None