Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
gsuuon
on Nov 15, 2023
|
parent
|
context
|
favorite
| on:
Push ifs up and fors down
The GOOD refactor would only work if the condition didn't depend on `walrus` and helps to make that fact explicit. If you apply "push fors down" again you end up with:
if condition { frobnicate_batch(walruses) } else { transmogrify_batch(walruses) }
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: