Part 7. Stepper
Normally, Programmers use debugging tools to detect errors early on, One such tool in Dr. Racket is the stepper tool, the stepper tool is used to evaluate every step of the program to show the programmer what is happening in the execution of the code.
This is an example code. As we write more complicated programs, we will need the use of the stepper to check the code during runtime.
The stepper is launched by pressing the step button beside the run.
When the stepper is launched, a new window opens, one by one, the code is evaluated.
The green color means that the expression has to be evaluated, the output of that is placed in color purple.
After the forward step is pressed, the right expression goes to the left and it is then evaluated
The next line is then evaluated, A function declaration does not produce any value but the parameter of the function which is an image is evaluated.
When the parameters of the function is evaluated, that function call is replaced by the function body, and the parameters have been assigned.
The condition is then evaluated, the expressions of the predicate has to be evaluated.
The predicate then produces a boolean value
The if-expression is evaluated and the appropriate expression is then evaluated
The final evaluation happens, and all expressions have been evaluated.
You can also step back to see the history.
Debugging tools are useful for more complicated programs, it is an indispensible tool for programmers, newbies and experienced coders alike.
Mga Komento
Mag-post ng isang Komento