The Open Closed Principle (OCP) is the most important principle of the SOLID principles. OCP means that any class/function should be open for extension, but closed for modification. Modifying existing code for every new feature is a bad practice. This leads to a continuous behaviour of writing code in a spaghetti programming style.

2m read timeFrom faun.pub
Post cover image

Sort: