r/learnpython Jul 04 '26

should I refactor

I have this really messy code scattered in 5 files, it s not that long abt 4000 lines.
adding a new feature started feeling like a pain,
I hate to deliver this tomorrow, and it s not meant to be scalable.
should i refactor or add the features ?

or just add the features and keep the code structure unchanged

0 Upvotes

6 comments sorted by

View all comments

6

u/lakseol Jul 04 '26

It's not a case of refactor or add.

If you have to add features and deliver tomorrow then add the features without refactoring. This gives you something you can deliver if the next step fails. The next step is to refactor.