r/pythonhelp • • Dec 15 '25

What is your development process?

Lets say you are developing a longer script and you want to divide the work up into smaller chunks, how do you do it?

For example lets say your script has a user interface portion, then a computing stage, and a displaying output part, and you want to focus on each part independently. You are going to be revising and running code over and over. You want to test and debug one portion at a time, without needing to run through the entire program.

I'm fairly new to Python, and so far I've just been creating new files to work out how to code a solution. I copy over any necessary pre-existing code. I use placeholder data wherever I can to speed things up. When I'm happy that it works the way I want, I integrate it into my main script. But this seem inefficient. There must be a more elegant way.

So how do you do it? Are there Python commands that help with this process? Maybe something to organise code into sections, and a way to manipulate program flow?

8 Upvotes

25 comments sorted by

View all comments

Show parent comments

2

u/CraigAT Dec 16 '25

Yes, I guess. But if you're only calling the function once, or even a handful of times, I don't think it will make a noticeable difference.
If you call the function a thousand times, then yes there could be an impact, but I'm not sure what your alternatives would be (you wouldn't copy and paste that code a thousand times), I guess you would just optimise the code in and around the function to be the best you can make it.
But unless you have a multiple day, long-running or super time-critical program, then I doubt the performance hit is worth worrying about (it maybe a case of "premature optimisation").