Answer the question
In order to leave comments, you need to log in
What is the essence of the best pattern for writing code with catching all errors?
Hello.
Actually, I would like to know, what do you think the pattern of the best writing of code with catching errors looks like?
The only thing that comes to mind is not to run each function while the key element in this function is 'undefined', and if it is not equal to undefined, then run the function through try / catch. There are doubts about the performance of such code, although they are almost not confirmed by anything. What do you think about this?
Answer the question
In order to leave comments, you need to log in
There are expected behavior and expected values.
There are actual ones.
In addition to the implementation of the functionality for controlling all intermediate states of objects (the UML diagram state register) and variables in the executable code with the ability to quickly disable this functionality, there are no other ways and cannot be.
/*BEFORE*/
////////TEST SECTION N////////
if (TEST) {
//test variables and object states (+update UML states registry)
}
//////END TEST SECTION N/////
/* MAIN WORK BLOCK CODE (from UML diagramm)
.....
*/
/*AFTER*/
////////TEST SECTION N////////
if (TEST) {
//test variables and object states (+update UML states registry)
}
//////END TEST SECTION N/////
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question