Lately, while working on a new project, I had a chance to think about the proper way to handle control flow. As all developers might know well, the most common approaches used are
if-else. So far, I haven't thought deeply about the difference between these two. From time to time, I think I mainly adopted a more concise way of writing code. Stability was significant on this project, applying the appropriate control flow processing approach was one of the keys. For this reason, I wrote pseudocode based on the scenario for these two approaches and compared them, and I'd like to share the result with this community.
Suppose that the signup logic of the virtual Web service 'A' is not allowed to have duplicate nicknames, e-mails, and phones.
The signup verification process is as follows:
1. Check for duplicate nicknames.
2. Check duplicate on personal information.
a. Verify email address is unique.
b. Verify phone number is unique.
What is PHP: - Who invented PHP, how it works, answers to all such questions about PHP, and much other information, you are going to