Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
yannickt
on March 7, 2017
|
parent
|
context
|
favorite
| on:
Writing good code: how to reduce the cognitive loa...
"If this was C, it should be NULL, and it is almost always better to just write `if (variable)` to check for NULL pointers instead."
Imagine that it was this instead:
if (5 != variable)
As the author points out, this was typically used by C and C++ developers to prevent accidental assignments inside conditional statements.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
Imagine that it was this instead:
As the author points out, this was typically used by C and C++ developers to prevent accidental assignments inside conditional statements.