Comprehensive Software Development Best Practices Guide

Table of Contents

Compiler

REPL

Interpreters

Evaluation

Design

SOLID

  • Single responsibility principle
  • Open/closed principle
  • Liskov substitution principle
  • Interface segregation principle
  • Dependency inversion principle

https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)

SRS

  • The Single Responsibility Principle

There should never be more than one reason for a class to change.

http://www.objectmentor.com/resources/articles/srp.pdf

Coding

Ruby

JavaScript

Testing

Deployment

Logging

https://docs.google.com/presentation/d/14PiMsvqs7f5A3_leDE07HoQkbHf_sUfuNHDShUMyT3A/edit#slide=id.g731d2a787_0_13

  • Crash
  • Enter debugger
  • Throw exception
  • Return special value
  • Set error flag
  • Recover, keep going

Debugging

Defects

  • Defect: An incorrect program code (a bug in the code).
  • Infection: An incorrect program state (a bug in the state).
  • Failure: An observable incorrect program behavior (a bug in the behavior).

Why Programs Fail: A Guide to Systematic Debugging, 2ed.

TRAFFIC

  • Track the problem in the database.
  • Reproduce the failure.
  • Automate and simplify the test case.
  • Find possible infection origins.
  • Focus on the most likely origins:
    • Code smells
    • Known infections
    • Causes in state, code, and input
  • Isolate the cause
  • Correct the defect.

http://www.whyprogramsfail.com/slides.php

Refactoring

  • Duplicate Observed Data
  • Encapsulate Downcast
  • Encapsulate Field
  • Extract Interface
  • Introduce Foreign Method
  • Introduce Local Extension
  • Pull Up Constructor Body
  • Pull Up Field
  • Push Down Field
  • Replace Delegation with Inheritance
  • Replace Type Code with Class
  • Replace Type Code with Subclasses
  • Add Parameter
  • Change Bidirectional Association to Unidirectional
  • Change Reference to Value
  • Change Unidirectional Association to Bidirectional
  • Change Value to Reference
  • Collapse Hierarchy
  • Consolidate Conditional Expression
  • Consolidate Duplicate Conditional Fragments
  • Decompose Conditional
  • Dynamic Method Definition
  • Eagerly Initialized Attribute
  • Encapsulate Collection
  • Extract Class
  • Extract Method
  • Extract Module
  • Extract Subclass
  • Extract Superclass
  • Extract Surrounding Method
  • Extract Variable
  • Form Template Method
  • Hide Delegate
  • Hide Method
  • Inline Class
  • Inline Method
  • Inline Module
  • Inline Temp
  • Introduce Assertion
  • Introduce Class Annotation
  • Introduce Expression Builder
  • Introduce Gateway
  • Introduce Named Parameter
  • Introduce Null Object
  • Introduce Parameter Object
  • Isolate Dynamic Receptor
  • Lazily Initialized Attribute
  • Move Eval from Runtime to Parse Time
  • Move Field
  • Move Method
  • Parameterize Method
  • Preserve Whole Object
  • Pull Up Method
  • Push Down Method
  • Recompose Conditional
  • Remove Assignments to Parameters
  • Remove Control Flag
  • Remove Middle Man
  • Remove Named Parameter
  • Remove Parameter
  • Remove Setting Method
  • Remove Unused Default Parameter
  • Rename Method
  • Replace Abstract Superclass with Module
  • Replace Array with Object
  • Replace Conditional with Polymorphism
  • Replace Constructor with Factory Method
  • Replace Data Value with Object
  • Replace Delegation With Hierarchy
  • Replace Dynamic Receptor with Dynamic Method Definition
  • Replace Error Code with Exception
  • Replace Exception with Test
  • Replace Hash with Object
  • Replace Inheritance with Delegation
  • Replace Loop with Collection Closure Method
  • Replace Magic Number with Symbolic Constant
  • Replace Method with Method Object
  • Replace Nested Conditional with Guard Clauses
  • Replace Parameter with Explicit Methods
  • Replace Parameter with Method
  • Replace Record with Data Class
  • Replace Subclass with Fields
  • Replace Temp with Chain
  • Replace Temp with Query
  • Replace Type Code with Module Extension
  • Replace Type Code With Polymorphism
  • Replace Type Code with State/Strategy
  • Self Encapsulate Field
  • Separate Query from Modifier
  • Split Temporary Variable
  • Substitute Algorithm

Author: Jason Walsh

j@wal.sh

Last Updated: 2024-10-30 16:43:54