MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/xly172/refactoring_just_working_solution/ipnd1m1
r/ProgrammerHumor • u/VitaminnCPP • Sep 23 '22
355 comments sorted by
View all comments
Show parent comments
1
No, it is never the answer. This is when you look at your index of design patterns, and figure out if one of them will handle these special cases. For example, strategy pattern or chain of command pattern.
1 u/nikniuq Sep 24 '22 I find in the real world a chain of responsibility pattern is overkill for a single function that needs to cater to a vendors penchant for edge cases.It should not be spaghetti but a bunch of clearly commented edge cases in a function is fine and often clearer than an overengineered alternative.
I find in the real world a chain of responsibility pattern is overkill for a single function that needs to cater to a vendors penchant for edge cases.
It should not be spaghetti but a bunch of clearly commented edge cases in a function is fine and often clearer than an overengineered alternative.
1
u/BetterOffCamping Sep 23 '22
No, it is never the answer. This is when you look at your index of design patterns, and figure out if one of them will handle these special cases. For example, strategy pattern or chain of command pattern.