Reducing Code Duplication in Swift using fundamentals of programming

Duplication, as the name suggests, is something that exists more than once. The same goes for code duplication. It's code that exists many times in the same codebase. An increase in the codebase, a subsequent rise in code duplication - is this what's happening with you? If yes, then: Have you ever thought about why this happens? The code duplication subsequently increases with time as many developers work simultaneously on similar functionalities in the codebase. Is it a good programming practice? No, because coding works on a fundamental principle called DRY, i.e., Don't Repeat Yourself! We must follow the