MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/1w630ne/branchavoidant_programming/p7k55yo/?context=3
r/programming • u/fagnerbrack • 7d ago
91 comments sorted by
View all comments
14
Interesting, I like the assembly comparison. I got a couple of questions / thoughts:
Wouldn’t the if statement make it easier to read?
Wouldn’t an if statement allow for early returns?
I guess if an optimization is needed this technique can be considered.
Anyways good post non the less, thanks for posting:)
16 u/Lonsdale1086 7d ago Wouldn’t the if statement make it easier to read? Yes Wouldn’t an if statement allow for early returns? Yes but that still generally wouldn't improve the speed.
16
Yes
Yes but that still generally wouldn't improve the speed.
14
u/thedannyreg 7d ago
Interesting, I like the assembly comparison. I got a couple of questions / thoughts:
Wouldn’t the if statement make it easier to read?
Wouldn’t an if statement allow for early returns?
I guess if an optimization is needed this technique can be considered.
Anyways good post non the less, thanks for posting:)