How to manage business logic with many and nested if else, switch and loops? via /r/learnprogramming


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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s