One of the best things to help with debugging since the invention of the print function is the AREPL extension in Visual Studio. It is beautiful, wonderful, fantastic, great, outstanding, genius, etc.
If you are not familar with it:
AREPL opens another screen that shows your data as soon as you type it in. It responds immediately to changes you make. I am terrible at explanations so let me demonstrate if I can.
Your program:
x = 3
print (x)
AREPL:
3
'Wow', you sarcastically say. How is that different from just running the code and seeing the print results?
It isn't but changes in the code happen immediately, right in front of you. If I change 3 to 4, AREPL changes to 4. Immediately. No running the code and looking in output for the answer. No stepping through your code, step by step using the debugger. AREPL has changed the way I code completely because it makes it possible to 'play around' with code and immediately see the results. If you code that way too, AREPL will be a great tool. Great tool for newbies. I temporarily set up a little function called prt in my code.
def prt(desc,*args):
print() #blank line
print(desc,*args)
then use
prt('sub1: ', x) #sub1-identifier that highlights the line in AREPL
in my code and the identified results show up cleanly and clearly in AREPL immediately.
1
u/EdwardWarren Apr 01 '21 edited Apr 01 '21
One of the best things to help with debugging since the invention of the print function is the AREPL extension in Visual Studio. It is beautiful, wonderful, fantastic, great, outstanding, genius, etc.
If you are not familar with it:
AREPL opens another screen that shows your data as soon as you type it in. It responds immediately to changes you make. I am terrible at explanations so let me demonstrate if I can.
Your program:
print (x)
AREPL:
'Wow', you sarcastically say. How is that different from just running the code and seeing the print results?
It isn't but changes in the code happen immediately, right in front of you. If I change 3 to 4, AREPL changes to 4. Immediately. No running the code and looking in output for the answer. No stepping through your code, step by step using the debugger. AREPL has changed the way I code completely because it makes it possible to 'play around' with code and immediately see the results. If you code that way too, AREPL will be a great tool. Great tool for newbies. I temporarily set up a little function called prt in my code.
then use
in my code and the identified results show up cleanly and clearly in AREPL immediately.
Try it out.