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
10 odpowiedzi
+ 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.
+ 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)
+ 2
VSCodium does not steal data, telemetry options are disabled by default
+ 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 )
+ 1
Dareen Moughrabi why significant time is spent on project requirements, and from there on laying out data structures and interactions.
Trying to change those after coding has already started can be a nightmare.
And a big reason why projects to upgrade some existing system can be the most frustrating and challenging coding challenges.
+ 1
Oh my.
A "client" with unclear or shifting design goals is one of the worst situations to be in.
Why the project designer often needs several interviews with the client to ask probing questions and get clarifications on prior answers
0
How do we learn more about python
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
0
Shardis Wolfe me being awake until now proves it being a nightmare ,the task we were given was given be my university course they gave us 12 days yet the kept changing the way the prgram is supposed to operated the first 8 days,they also gave unclear instruction so i could not really lay out a thought through program
0
So given the time period i had to dive in and since now we Have clearier instruction i can think of a way to make the program more easy to read i do want to get some actual learning experience from this but surely i would have liked use my time more optimally