Quote:
Originally Posted by mrynit
dont do assignments in a while statment like that. the only thing that should be going on in the while(...) is a boolean test condtion.
|
There is no "should" about it, unless you are working with a zealous style guide.
There is nothing technically wrong with doing an assignment within the while expression.
Non-technically, it is often viewed as bad style because it is possible to introduce unintended errors or problems with code maintenance. Particularly with careless programmers -- but careless programmers will probably not comply with style guidelines anyway.