I'd argue that, especially in this case, it'd be more logical and pleasingly symmetric code to use exit(string result) on every line, and delete the empty result initialisation. 🙂 If the code changes, the compiler should warn us (I think) if we might be exiting without assigning a return value.
@aarondcmedia95852 ай бұрын
For youtube search results, do you think "Setting a breakpoint on an exit statement" would be more successful as a video title?
@Graham_Wideman2 ай бұрын
I agree -- this video is not about "you" nor "stopping", it's about the debugger breaking. The current title sounds more like advice about driving your car on the motorway! Nonetheless a useful tip.
@codegearguru2 ай бұрын
Done. Thanks. I don't always get to spend much time thinking about a title, or description. It's about having a window of time to record something, and getting it all done. I did make a thumbnail though, so progress?
@aarondcmedia95852 ай бұрын
@@codegearguru good progress!
@exeware2 ай бұрын
It doesn't breakpoint because it's a compiler optimization, if you start using exit(0) just to be able to stop you're missing a good optimization.
@codegearguru2 ай бұрын
Certainly if it's something that's being called extremely frequently, but these days, I go for maintainability just about every time.
@trnod2 ай бұрын
Just put a comment behind the Exit; where you threatens to start using C++ instead... That will make the compiler step up its game...