2 ms·
Going a bit off topic but I really hate when you have a bit of code you can either have 2 functions with some repetition or one function that gets ugly because
by robryan 16y ago
Going a bit off topic but I really hate when you have a bit of code you can either have 2 functions with some repetition or one function that gets ugly because of the number of if statements required based on parameters. Both options feel suboptimal.
- HeyLaughingBoy 16y agoI've found that sometimes passing in a function/function pointer as a parameter makes this a lot cleaner.