How to manage business logic with many and nested if else, switch and loops?
I started to work on a C# codebase that has its business logic all messed up with nested if-else, switch and loops. For example, a method, which is ~1100 lines, declares an object at the top and mutates it throughout the method before doing something with it at the end. Not only its BS but so difficult to understand, read and debug.
If I were to refactor this shit, how would I contain all the nested if-else and stuff into organized business logic code? Samples, resources or suggestions in any form is really appreciated.
Submitted July 15, 2017 at 09:23AM by nummer31
via reddit http://ift.tt/2tWoqz6