Re:Interesting Bugs Caught by ESLint's no-constant-binary-ex...
by porridgeraisin on Thursday November 09, 2023 @02:10AM
(#38202037)
It's very common in C
The ` != null ` is redundant here but you can imagine where it'd be required.
[ Parent
| on HN ]
Re:Interesting Bugs Caught by ESLint's no-constant-binary-ex...
by sweetjuly on Thursday November 09, 2023 @03:22AM
(#38202417)
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.
Re:Interesting Bugs Caught by ESLint's no-constant-binary-ex...
by demondemidi on Thursday November 09, 2023 @11:39AM
(#38207256)
You are arguing "common" == "good". That's not true.