var password = "1"
while true {
//Execute some code here
}
My question is about the second line of code. It doesn't provide a condition before the true value. Is that allowed? Isn't this invalid syntax since it has no condition to check for true value? Aren't I supposed to state what condition to check for??
For what it's worth, I've been programming for over a decade and a half and still think while true looks nonsensical, despite its ubiquity. A repeat statement without the following while would be much easier to understand.
In other languages about a third is for "loop" another third for "while true" / while 1". "Loop" looks somewhat nicer but it doesn't look realistic to add it to Swift at this point.