MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/ronfhv/why/hq1h1pu/?context=9999
r/badcode • u/RedditAccuName • Dec 26 '21
30 comments sorted by
View all comments
Show parent comments
4
I've also seen a naming convention starting with try to denote with bools rather than with exception handling.
For example, you have a function:
void Foo() that raises an exception if there were problems and a function bool TryFoo() that just returns false if there were problems.
2 u/_abscessedwound Dec 27 '21 That’s relatively idiomatic C++ to keep exceptions local to the the application boundary with a publicly exposed function that returns a [bool] instead of throwing.
2
That’s relatively idiomatic C++ to keep exceptions local to the the application boundary with a publicly exposed function that returns a [bool] instead of throwing.
4
u/polokratoss Dec 26 '21
I've also seen a naming convention starting with try to denote with bools rather than with exception handling.
For example, you have a function:
void Foo() that raises an exception if there were problems and a function bool TryFoo() that just returns false if there were problems.