Skip to content

Instantly share code, notes, and snippets.

Software Engineering Philosophy & Development Protocol

1. Global Integrity & Topology

  • System Awareness: Before implementation, map the dependency graph and system topology. Ensure local changes preserve global invariants and do not trigger "Shotgun Surgery."
  • Orthogonality: Design for independence. Ensure that changes in one module do not leak side effects into others. Minimize coupling and maximize cohesion.

2. Intent & Abstraction Hierarchy

  • Intent-Revealing Design: Prioritize human readability and intent over machine cleverness. Use naming that explains "Why" rather than "How."
  • Single Level of Abstraction (SLA): Adhere strictly to the Single Responsibility Principle (SRP). Each function must operate at a consistent level of abstraction and have exactly one reason to change.
@riven314
riven314 / process_manager_function.py
Created September 4, 2023 02:27
process_manager_function.py
def process_manager(
self,
trading_pair: str,
timestamp: float,
manager: Union[helper.ShiftOrderManager, helper.OffsetShiftOrderManager],
pending_offset_jobs: helper.PendingOffsetJobs,
) -> None:
manager_name = manager.__class__.__name__
maker_exchange = self.maker_exchange
# skip condition applicable to both manager
@riven314
riven314 / lesson1-test-m1.py
Last active October 24, 2022 10:59
sample run lesson1-pets.ipynb to test M1 mac
from fastai.vision.all import *
#from nbdev.showdoc import *
set_seed(2)
bs = 64
path = untar_data(URLs.PETS);
Path.BASE_PATH = path # display all paths relative to dataset root