Duplicating code can make different features easier to understand and debug. For example, keeping local and server save/load paths separate makes it clearer where a source-specific bug lives and helps prevent loading data from the wrong place. section 7.1.8 section 7.3
Choose whether to duplicate or share code based on what the code does:
- Keep implementations separate when sharing them could make a change to one feature break another. section 7.1.8
- Share code when it performs one action: take data in, transform it, and output data. Split it into smaller functions if it grows to do more. section 7.3
Figure 7.6 Saving and loading code should be separated by source, but any common code can be moved to a shared static function.

Shows separate save/load paths by source, with common code suitable for a shared static function. section 7.1.8





