Timeline for Are "Distributed Enums" an Anti-pattern in non-OOP like they seem to be considered in OOP?
Current License: CC BY-SA 4.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 30, 2023 at 18:19 | history | edited | Doc Brown | CC BY-SA 4.0 | added 2 characters in body |
| Mar 30, 2023 at 18:18 | comment | added | Doc Brown | ... that way, you need only one place in the program where a "language enum" is evaluated, and only one place to extend when a third language is added. This is unrelated to "OOP vs functional vs procedural", it is a general design principle which can be applied in any paradigm. | |
| Mar 30, 2023 at 18:14 | comment | added | Doc Brown | @Bergi: orthogonal design often starts at the way which UI options or configuration options you offer to the user. Lets say you design the UI of a calculator program like the one from the link provided by the OP, and the calculator allows to switch between two different languages with different number formats. One can now add several "if(language==L1) .. else" blocks to the program, or just derive parameters from the language like a decimal separator once in the program, and make the remaining part of the program rely on that decimal separator. | |
| Mar 30, 2023 at 18:05 | comment | added | Doc Brown | @Peter-ReinstateMonica: OOP was advertised as a solution to improve maintainability of ever larger programs, but only partially fulfilled that promise. Of course, OOP means can indeed help to achieve this goal to some degree, but not automatically. You don't create a single-source-of-truth design just by using OOP means, you also have to use them well. Often, such design has nothing to do with OOP - it can actually start at the requirements level, by giving a user orthogonal configuration options, for example. | |
| Mar 30, 2023 at 15:19 | comment | added | Peter - Reinstate Monica | @bracco23 Yes, of course! The gist of my comment was that I find myself employing the same techniques to cope with complexity in C that were incorporated in C++, for the same reasons. | |
| Mar 30, 2023 at 14:19 | comment | added | bracco23 | @Peter-ReinstateMonica that sounds like C++, with extra steps /s | |
| Mar 30, 2023 at 14:17 | comment | added | Peter - Reinstate Monica | Don't forget that OO was conceived as a solution to improve maintainability of ever larger programs. That's why we keep types and operations on them together. I find myself programming poor man's OO even in non-OO plain old C: Yes, I want only initialized objects; yes, I want strong types (feet are not meters; I have different structs containing just one double each!); yes, I have tables with operations if necessary, emulating classes or even polymorphism. You can program a macro assembler, but you don't have to. | |
| Mar 30, 2023 at 12:54 | comment | added | Bergi | What does "orthogonal design" mean here? Wouldn't that just be polymorphism/strategy patterns again? | |
| Mar 30, 2023 at 10:35 | history | edited | Doc Brown | CC BY-SA 4.0 | added 219 characters in body |
| Mar 30, 2023 at 9:28 | history | edited | Doc Brown | CC BY-SA 4.0 | added 45 characters in body |
| Mar 30, 2023 at 8:39 | history | edited | Doc Brown | CC BY-SA 4.0 | deleted 4 characters in body |
| Mar 30, 2023 at 7:59 | history | edited | Doc Brown | CC BY-SA 4.0 | added 51 characters in body |
| Mar 30, 2023 at 7:53 | history | answered | Doc Brown | CC BY-SA 4.0 |