Controlling the flow of your code is important. Programmers want to control the logic of their code for many reasons; one of the main reasons is that the user of the software should have many options open to them.
You may not know the conditions beforehand, in which way your programming logic should move, though. You can only guess, so as a developer, you should open as many avenues for the user as possible. There are several techniques you can adopt to control the flow of the code. For example, the if-else logic is popular.