Timeline for Search for providers of TV Shows
Current License: CC BY-SA 4.0
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 23, 2022 at 14:42 | comment | added | AJNeufeld | The Single Responsibility Principle is good; a function should do one thing and do it well. Displaying a menu is one thing - and can be moved into its own function. Asking a question is one thing - with two parts (displaying the question & getting the result); the two sub parts can be done in their own functions called by the "asking a question" function. Your main function does more than just "ask a question", so it shouldn't be the one calling the "question & answer" subparts of "asking a question"; it needs an intermediary (possibly more than one). Hope that helps. | |
Mar 23, 2022 at 9:27 | comment | added | Twam | Thanks a lot! The reason I had them in seperate function was that I learned about the Single Resposibility Principle recently and thought that it would be good practice to separate the displaying of the menu to the if statement but it seems that I was going about the principle in the wrong way. | |
Mar 22, 2022 at 5:54 | history | answered | AJNeufeld | CC BY-SA 4.0 |