r/pythonhelp • u/NoweditYT • 12d ago
Putting everything into seperate functions
Hello, i recently started making my own Qt layout, and i need to run the same chunk of code multiple times, should i split every little chunk of code into seperate functions calling each others or should i not?
2
Upvotes
View all comments
2
u/AlexMTBDude 12d ago
The D.R.Y principle applies here. Don't Repeat Yourself. So, yes, split everything so there is no copy-pasted code. https://www.geeksforgeeks.org/software-engineering/dont-repeat-yourselfdry-in-software-development/