The wild while loop
Efficiency is important in some languages while less so in others. When you're running a program in PHP you have only one computer that is serving hundreds of people. Therefore, it’s important that each line of code is as efficient as it can be. Contrary to that, client-side programming languages such as JavaScript don't need to be as efficient. Since you only have one computer running the script at a time. That's why I personally prefer doing what's more comfortable and not necessarily what's more efficient on client-side programming languages.
Note: The for loop isn't as efficient as The while loop. If you are an inefficiency geek, you will want to stick to while loops.
Ready to Level Up Your Skills?
Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!
Enroll Now for Free!