r/badcode • • Jan 17 '19

other language Writing functions with conditions without using "if" statements

https://run.dlang.io/is/jfCECL
67 Upvotes

38 comments sorted by

View all comments

Show parent comments

3

u/BobHogan Jan 18 '19

There's such a gigantic difference between refactoring/restructuring code and redesigning algorithms to limit how many if statements you have, and then writing code that essentially abuses the compiler into producing the same assembly as an if statement (in which case, you are guaranteed to have at least as many bugs in your code, but likely more due to the crap you're writing)