Best way to do modification without breaking OCP
Hi I have a very large code base and one file contains so many functions (not as a class members). For example, callback from 1 to 90. Now need to add one more that is 91 which is too similar to existing 90 I have two options: 1. Solution: Add callback_91 , copy code from 90 and modify this. Benifit: Dont want to change anything in working code of callback_90 Issue: Just repeated code and have very large code base now along with duplication. Another approach: 2. Solution: Create a common function and call this function from callback_90_New and callback_91_new Issue : Modified the existing code which is tested (callback_90 functionality) Benifit: Could avoid DRY(dont repeat yourself) Which is best and good to opt for ? https://code.sololearn.com/ccq1KiVV8Me2/?ref=app