This mental castle is a walk through Onni, SLU, from the Pickleball Gym to the Fairview Postboxes.
Design Principles
Pickleball GymComplexity is incremental: you have to sweat the small stuff.You need playersWorking code isn’t enough.Shitty netMake continual small investments to improve system design.Serve deepModules should be deep.Couch areaInterfaces should be designed to make the most common usage as simple as possible.Music/Toilet/Main DoorDifferent layers should have different abstractions.Hallway -1 Outside GymPull complexity downward.Non-closing door under StairsDefine errors (and special cases) out of existence.StairsDesign it twice.TokenComments should describe things that are not obvious from the code.
Red Flags
Onni HallwayShallow Module: the interface for a class or method isn’t much simpler than its implementation.Renters OfficeInformation Leakage: a design decision is reflected in multiple modules.Seattle TimesTemporal Decomposition: the code structure is based on the order in which operations are executed, not on information hiding.Hotel LobbyOverexposure: An API forces callers to be aware of rarely used features in order to use commonly used features.Cycle RoomRepetition: a nontrivial piece of code is repeated over and over.Gym RoomPass-Through Method: a method does almost nothing except pass its arguments to another method with a similar signature.Swimming PoolSpecial-General Mixture: special-purpose code is not cleanly separated from general purpose code.Conference RoomsConjoined Methods: two methods have so many dependencies that its hard to understand the implementation of one without understanding the implementation of the other.Tapping Token Twice to get to FairviewComment Repeats Code: all of the information in a comment is immediately obvious from the code next to the comment.Front Desk LadyVague Name: the name of a variable or method is so imprecise that it doesn’t convey much useful information.Entrance to FairviewHard to Describe: in order to be complete, the documentation for a variable or method must be long.Postbox Name Tag TrickNonobvious Code: the behavior or meaning of a piece of code cannot be understood easily.