Hacker News new | past | comments | ask | show | jobs | submit login

So technically not "do/while", but:

  while(some_condition):
    do_stuff



No, it's actually this:

  do_stuff
  while(some_condition):
    do_stuff
The advantage of do/while in this situation is avoiding the duplicate code.


I prefer:

    while True:
        codeHere()
        if shouldStop():
            break


More like:

  do_stuff
  while(some_condition):
    do_stuff


Ahh yes - point taken.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: