back

by porridgeraisin·2y ago·view on hn ↗
It's very common in C

  while((buf = resultofstreamingoperation() != null) {
    
  }
The ` != null ` is redundant here but you can imagine where it'd be required.
2 comments
A more common form (and slightly less evil) is for error checking:

    if ((error = do_a_thing())) {
        // some error happened, good thing we saved the error code
    }
Given the standard "zero is success" paradigm, handling errors is very succinct.
You are arguing "common" == "good". That's not true.