Hacker News new | ask | show | jobs
by mattiss 6067 days ago
I would argue that this is pretty unreadable. Why do obfuscate your code to save one LOC?
2 comments

It's common in C where functions return an error code instead of a value that you would use again. Then the conditional just checks that you're OK to go ahead, and you don't need to declare another variable to store the error code. (If a language has exceptions, then this isn't as useful.)
I write C full time for the day job and it normally goes something like this:

if ( !method_returns_rc( args ) ) { //error handle }

This isn't great, as I believe its not good to put methods with side effects in if statements (may be wrong here, or maybe its just me), but generally thats how its done (not to say that there aren't freaking GOTOs in our code... so take that with a grain of salt.)

One man's obfuscation is another man's expressiveness.