r/ProgrammerHumor • • Sep 23 '22

Refactoring "Just working solution ".

Post image
54.8k Upvotes

355 comments sorted by

View all comments

Show parent comments

1

u/[deleted] Sep 23 '22

[removed] — view removed comment

2

u/ConsistentAddress195 Sep 24 '22

That's true. Whenever I feel a piece of code is getting too complex, I will sketch it out high-level(UML diagram) and try to understand it better. Usually a more elegant solution will emerge. That said, I think most refactoring revolves around applying the single responsibility principle. E.g. "separate the processing/scheduling of tasks from the task implementation", stuff like that.