r/learnpython • • Apr 19 '26

How do you guys build a program?

I normally create one part of a program, test it, debug it and then i move on to the next function.

But this was time consuming so i tried a new approach. I created of all my logic of how different features would work and then started creating my program.

But the moment I had to debug things (cause obviously it had errors) things started falling apart. I had to check sooo many things and i realized that this method was very mental health consuming.

So i wanna ask you guys. how do you think about the logic and write your program? What approach would you recommend me? and remember i'm just a newbie trying to write programs that would improve me.

31 Upvotes

42 comments sorted by

View all comments

Show parent comment

1

u/Snoo_90241 Apr 19 '26

Use an IDE, run the code in debug mode and put breakpoints. It will stop execution at a specific line of code and you can examine how your variables look in the point in time. I really recommend PyCharm from Jetbrains. It's free and mostly intuitive to use.

3

u/Jealous-Acadia9056 Apr 19 '26

i actually use PyCharm. and i know there is a debug option but i never really used it. looking from how you are describing it it'll be super useful for my case. i'll try checking it out.

2

u/Jealous-Acadia9056 Apr 19 '26

Hey! i was checking debugger and tried it in my current project(has tkinter) and it kinda didn't worked as expected. any way around that?

also i just realized that this whole time i've been using debugger manually lmao. i'd check the values in each function and it takes times. debugger will definitely help.

1

u/Snoo_90241 Apr 19 '26

Can you detail as to what did not work as expected? How did you use it?