4 ms·
I've seen people use exceptions for flow control: rather than constantly checking if it's OK to keep doing something, just keeping doing it until there's a prob
by jamesbritt 16y ago
I've seen people use exceptions for flow control: rather than constantly checking if it's OK to keep doing something, just keeping doing it until there's a problem, handle it, then gracefully stop.
That's something I do all the time in real life.
- mkramlich 16y agosimilar here. this pattern reminds me also of "better to ask forgiveness than permission" in order to maximize productivity. Just Do It. alter/correct/stop later if/as needed.
- dkarl 16y agoThat's an idea that I explicitly learned from computing, coming from a mathematical background where that pattern doesn't really have an analogue. I really never thought that way until I conceived of it as an adult and immediately connected it to some code I had written recently. The closest pattern of thinking I had prior to that was the idea of the scientific method, which isn't exactly the same and isn't nearly as applicable to problems in daily life.
- ScottBurson 16y agoAre you kidding? I use the scientific method quite consciously all the time. Form a hypothesis, try to come up with some relevant experiments, perform them, notice that they (usually) disconfirm the hypothesis, repeat until the hypothesis is not disconfirmed.
- deleted 16y ago[deleted]
- tricky 16y agoooh, my wife hates that. I typically fix our cars myself when they break. When something starts making noise that I can't diagnose, I do everything I can to make it worse hoping it'll help me figure out the problem. Apparently, that's counter-intuitive.
- arethuza 16y agoMy wife is far more analytical about most tasks than I am - I drive her crazy by not really being able to explain how I can fix most things, using a process she describes as "fiddling randomly until it works".
- kragen 16y agoYour mechanic might hate that too. One difference between software and hardware is that you can't just revert the checkin that cracked your cylinder head when you were over-revving the engine to see if you could make the ping louder.