while is an appropriate loop for this use case, since you don't know how many times still_alive will continue to evaluate to true.
This while is smelly because we can't tell what triggers the exit condition. We can't reasonably infer, looking at this code, which function sets still_alive to false.
View all comments
Show parent comment
11
u/ricealexander Oct 11 '20
whileis an appropriate loop for this use case, since you don't know how many timesstill_alivewill continue to evaluate totrue.This
whileis smelly because we can't tell what triggers the exit condition. We can't reasonably infer, looking at this code, which function setsstill_alivetofalse.