[MECpp]Item-18 Amortize the Cost of Expected Computations
· β 3 min read
The old Computer Science story: trade space for time1.
The old Computer Science story: trade space for time1.
The 80-20 rule states that 80 percent of a program’s resources are used by about 20 percent of the code.
Exception handling has costs, and we pay at least some of them even if we never use the keywords try
, throw
, or catch
.
Exception specifications provide a documentation aid and an enforcement mechanism for constraints on exception usage, but they are only partly checked by compilers and they are easy to violate inadvertently.