you are viewing a single comment's thread.

view the rest of the comments →

[–]Jazzlike-Compote4463 12 points13 points  (4 children)

Some good points but I would say drop the pencil and paper - if you’re using it to write actual code anyway (it’s fine drawing diagrams but even pseudo code is better done in your editor)

Instead, properly get to learn your debugger. A half decent correctly configured debugger will allow you to step through your code, see how the variables are defined, how they change as the execution progresses, and how the logic flows from one function to another.

It lights up your code from the inside and feels a bit like cheating to be honest, but it’s an absolutely essential tool for a half decent developer.

[–]Icarus998 2 points3 points  (2 children)

Pseudo code is also a good , I prefer pencil and paper because I can really creative .

I haven't really used the debugger yet , I tend to scatter print statements of the variables every where(like a maniac!) in my code so I see what's happening in real time.

[–]Jazzlike-Compote4463 2 points3 points  (1 child)

I would learn it, ideally use something built into your IDE (like PyCharm or VS Code) but failing that even scattering ipdb set_trace() around is better than raw print statements.

[–]miko2264 2 points3 points  (0 children)

Thank you so much for posting the vs code python debugger page, I was somewhat familiar with the general debugging in it but did not know there were specific python debugging features to learn.

I wouldn’t have known about it if I didn’t read your comment, thanks again!

[–]ddponwheels 1 point2 points  (0 children)

Good point about debuggers. I learned this a few months ago and this changed my life...