Comment on Real quick question about the "break"
UnRelatedBurner@sh.itjust.works 11 months agoThanks, it makes sense. I just don’t yet see how I’d reduce the number of ifs*, but I guess it’s a case by case thing.
- simplest I can think of is let’s say we need different logic based on a number’s parity. How do I avoid
if x % 2 == 0
?
crashfrog@lemm.ee 11 months ago
What would be an example where you need different logic based on a number’s parity? Why wouldn’t you write logic that ignores the number’s parity?
Part of getting better as a programmer is realizing which stuff doesn’t matter, and writing less code, as a result.
UnRelatedBurner@sh.itjust.works 11 months ago
oh, okay, I hear you. Thanks
crashfrog@lemm.ee 11 months ago
Good luck