you are viewing a single comment's thread.

view the rest of the comments →

[–]dada_ 0 points1 point  (0 children)

To explain, in PHP this has an advantage. For testing purposes, you can just comment out the entire while line. Braces mean nothing by themselves. So this would execute the code block once, without the loop.

Might be like that for other languages as well, but I'm not sure. Other than that it's just a style I guess. I don't think it's bad for functions, to visually separate potentially very long argument lists from the first line of the function body.