0

Making an app tidy and clean

I almost done building a program -biology related. - that runs from the command line And the code is getting too messy and repetitive that i am not sure how to refactor it , How would you approach such a program in order to make it easy to read for other programers , how does determine what functions to turn into classes what functions can be taken into pieces and so on

3rd Feb 2025, 2:23 PM
Dareen Moughrabi
Dareen Moughrabi - avatar
6 Answers
+ 2
I'm not a JetBrains fan but try to open it with PyCharm, install SonarQube plug-in.... I'm not a vscode fan but try to open with it and install SonarQube plug-in.... or open with VSCodium, and install SonarLint (I'm using VSCodium)
3rd Feb 2025, 3:45 PM
Mihaly Nyilas
Mihaly Nyilas - avatar
M
+ 2
VSCodium does not steal data, telemetry options are disabled by default
3rd Feb 2025, 4:20 PM
Mihaly Nyilas
Mihaly Nyilas - avatar
M
+ 2
Dareen Moughrabi You might try creating a flow chart on paper. If trying to convert your project into object-oriented design, focus first on the data and how it might be grouped into objects which then interact with each other. With biology related project, maybe you can group data by organisms, organ systems, individual organs, types of cells, or nutrients/molecule transmitters. Once you have the data divided into classes/objects, you can turn the interactions between them into methods. For any sections of code which are highly repetitive, maybe you can turn that into helper functions called by other functions. Similar to how sort methods handle the logic of sorting but use helper function to do the actual data swapping.
3rd Feb 2025, 11:34 PM
Shardis Wolfe
+ 1
Mihaly Nyilas thanks i will try it , also what makes you a fan of VSCodium i tried the two other options above never tried the one you use i will give it a try when i can , i read about it for now it seems like its spyware free , less computer heavy does not have microsoft extentions ( which i do not use anyways so not a plus or minus )
3rd Feb 2025, 3:53 PM
Dareen Moughrabi
Dareen Moughrabi - avatar
0
How do we learn more about python
3rd Feb 2025, 4:04 PM
William Otieno
William Otieno - avatar
0
Shardis Wolfe I followed through your advice from run time to general structure there is an improvment i am dividing the program useful classes and using utility functions in both yet i certanily regret building terminal command line control and testing files and additional program features before changing into classes it certainly made things messy to organize and time consuming i hope i learn from this for the future i will get back into refactoring thx both Mihaly Nyilas
4th Feb 2025, 8:44 PM
Dareen Moughrabi
Dareen Moughrabi - avatar