Questions to ask when determining which of these loops to use
I thought of some questions to ask when determining what loops to use, and asked ai if that was correct, and ai told me yes.
Questions to ask to see if a loop need to be used:
  • Do I have more than one item that needs to be updated, shown to the user or process in some way(If yes, use loops)
  • What tasks do I need to use loops for?
  • If yes, what type of loop do I need to use? (Which the second set of questions below can help determine which loop to use)
These questions are for finding out what type of loop to run:
  • Do I know how many times I want this code or condition to run (if yes, use for loops, if no, use while loops)?,
  • Do I want to check to see if the condition is true (if so use do while loops)
  • Do I want/ is the condition supposed to run the code at least once even if it isn't true? (If so, use the do while loops)
These are the questions and ai told me yes, this is correct, and I thought I would share this because it helped me to know when to use which loop, and I hope this help someone too because it helped me because I was a little confused about that.
Hayk, if I got something wrong in what I learned, can you give me feedback? Can you give me feedback and what you think of this Hayk?
1
0 comments
SeaAmber Silver
6
Questions to ask when determining which of these loops to use
Dev Mastery
skool.com/devmastery
Break out the mid-tier developer trap. Get to Senior, fast.
Leaderboard (30-day)
Powered by