Original Post
I have been teaching myself programming off and on for a few years now, and I am beyond beginner status in many ways, but I seemed to have missed something very important in my teaching.
What is the benefit of using if conditionals instead of while? What I mean to say is, what is the difference, beyond the ability to use multiple break conditions in while statements? I always use if, but a great deal of example code I find, especially in scripting, uses while commands. Can someone explain to me the pros and cons? I am doing really well in my scripting, I have made some advanced scripts for my game betas and demos, but I need to know this. I have implemented both types of conditionals, but I really want to know the nuances of the variations. Thank you guys! (and gals).
What is the benefit of using if conditionals instead of while? What I mean to say is, what is the difference, beyond the ability to use multiple break conditions in while statements? I always use if, but a great deal of example code I find, especially in scripting, uses while commands. Can someone explain to me the pros and cons? I am doing really well in my scripting, I have made some advanced scripts for my game betas and demos, but I need to know this. I have implemented both types of conditionals, but I really want to know the nuances of the variations. Thank you guys! (and gals).