Y
Hacker News
new
|
ask
|
show
|
jobs
by
kentosi
3647 days ago
I guess the alternative would be:
if (isValidUser() && isValidData(data)) …
Which would avoid the potentially expensive `validate()` without putting it all on the one line.
1 comments
elwell
3647 days ago
Not really, because the code comment above mentioned that one of the primary purposes of this technique is to reduce function overhead.
link