Here's my opinion:
Should I replace them with ASSERTS?
If a client misuses an interface or there is an internal/state error, it is good to use assertions to verify program and state correctness, and prevent clients from misusing the program. If you disable assertions in release and prefer to throw after that point, you can do so. Alternatively, you could add that assertion behavior to the ctor of the exception you throw.
Since I won't catch these exceptions I shouldn't be a victim of this bloatage right ?
I built out an app I wrote with exceptions enabled (I have them disabled by default). The size went from 37 to 44 MB. That's a 19% growth, and the only code that used exceptions was in std
. The meat of that program does no catching or throwing (after all, it can build without exceptions enabled). So, yes, your program's size will grow - even if you don't write a throw
or catch
.
For some programs, that's not a problem. If you use libraries that are designed to use exceptions for error handling (or worse), then you really can't work with them disabled.
...how high are the chances that logic errors would find their way into a final build ?
That depends on the complexity of the program. For a nontrivial program with a moderate to high level of error checking, it's quite easy to trigger an assertion out in the wild (even if it's a false positive).
Since we like to answer focused questions, here is mine: What would you do, and why ? :D
Retroflowing a program which uses exceptions to use error codes is a painful experience. At minimum, I'd add assertions to the existing program.
There are certainly complex programs that do not require exceptions, but why does yours not need them? If you can't come up with a good answer, then you should probably continue writing exceptions in the appropriate places, and add assertions to verify consistency and to ensure the clients don't misuse the programs.
If you do in fact have a good reason to disable exceptions, then you will likely have a lot to rework, and you'll need some form of error handling - whether you use an error code, logging, or something more elaborate is up to you.