-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change do {} while(true) to while(true) {} #167
Comments
You know, I was going to die on this hill ;) (especially because it's subjective) Alas, I put this to a straw poll of 1000 java devs ( closed audience ) and lost 14:1 (with one person demanding So, fair enough. But out of sheer (1/schadenfreude) I'll close #17 . Because THAT HILL IS MINE TO DIE ON. ;) |
lol noooo, THAT guy is right, (seriously, i do that; it's less verbose and there is no condition to look at.) |
but i do agree on |
hehe - I mean you could still make an interface that lets somebody use their own formatting standards (please don't) |
Oh hell no, it doesn't look aesthetic and an amateur wouldn't understand it imo |
I got a better one 😉 label-begin: {
// code here
goto label-begin
} |
Looks like krakatau |
its inevitable, CFR will have to be hostile-forked now |
FWIW this is why I prefer the while(true) ;) - it's clearly a goto at the end of the block. |
If you'd make a statistic of what is used most, while(true) {} will probably win by far. Also oracle docs specify while(true) {} as infinite loop: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/while.html |
FWIW - I already mentioned this in #17 - If someone wants to bolt a code-style plugin on afterwards, feel free, but that's definitely not a reasonable thing to incorporate. |
These loops in CFR output
should be changed to
A do while loop insists that the condition is at the end and when I encounter a loop the first thing I want to know is what the condition is. Thus, I am forced to look for the end of the code block of the loop just to find out it is an infinite loop. In conclusion, changing those loops to while loops will improve readability.
The text was updated successfully, but these errors were encountered: