From: "Brent Longborough" <[email protected]>
Sent: Friday, December 07, 2018 11:24 PM


IMHO this is a Code Smell.

If you need the CC in order to print it out for debugging, it's probably
more useful to print the data that led to that CC.

If you want to save the CC, go off somewhere and do something else, and
restore the CC when you get back, that can be buggy

It's not going to be "buggy".
It's simple and trivial.

and make debugging difficult.

For me, it's better (where simple enough) to repeat the test that
produced the CC: the code is much clearer.

Why repeat the computation. That can be buggy,
because some of the values used in arriving at the CC
may have been changed in the meantime.

If the test cannot be reproduced after the "something else", then it's
conceivable that the CC isn't even valid any more,

The CC can be restored trivially.

and, of course,
debugging the original setting of that CC is likely to be difficult.

No it isn't.

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

Reply via email to