Skip to main content
3 events
when toggle format what by license comment
Sep 7, 2022 at 13:16 comment added Christian Hujer P.S.: Still upvoted. Yes, a dict. Changing the solution to use a dict right now. (Already using a map in most other languages, like Java, Kotlin, C++.)
Sep 7, 2022 at 13:14 comment added Christian Hujer I know that this is the definition of Bertrand Meyer's OCP that Robert C. Martin usually gives. I disagree with this definition because it makes it sound that the problem is specific to object-oriented programming with classes. The real problem that the OCP addresses is that adding something in one place will require making changes in other places as well. In that spirit, the code follows the OCP already. My definition: "It should be possible to add behavior by adding code rather than modifying existing code."
Sep 7, 2022 at 12:47 history answered janos CC BY-SA 4.0