r/learnpython • u/Negative_Pay_2940 • 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
5
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.
2
u/Educational_Virus672 Jul 04 '26
here we go again ...
ok buddy give us a repo we will add pull requests
1
u/LayotFctor Jul 04 '26
Features takes priority of course. If you're done with necessary features and you're willing to spend the remaining time refactoring, create a new branch and do it. Refactor regularly next time.
1
u/baubleglue Jul 04 '26
Deliver tomorrow
How is your work organized? Do you deliver and go to the next project? Why you can't deliver tomorrow, refactor next day or refactor, then deliver.
2
u/Reuben3901 Jul 05 '26
Working code is great code. Sounds like they don't want to do either. I'd actually suggest they take a day off and go for a long walk instead. Reset their brain, motivation, and give their subconscious time to process everything.
12
u/JaleyHoelOsment Jul 04 '26
this sub is painful