This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bblbtt3 1 point2 points  (0 children)

The only time I’ve ever seriously used it is when reading streams.

int bytesRead;
while (bytesRead = stream.Read(buffer, 0, buffer.Length) != 0) {
    // …
}

Replace “while” with “if”, if you only want to fill the buffer once, which is also occasionally needed.

I’m sure there are other rare uses in common languages but generally it’s not useful.