It's official. This is already the biggest program I have written to-date. And with that realization came a vision of the future: one in which the program got so clunky and large that it stopped being fun to work on.
So on the heels of my first major project success, and on the edge of diving into optimization, I am cooling off, looking back and doing some extensive housekeeping. (more like re-modeling)
Where it hurts:
- When adding new scaling arrays, it takes a while to add all the update, report, load and save functions.
- When I'm communicating with the arduino, updating new parameters is getting clunky and depending on copy-paste.
- when I have to add new serial controls, that switch is getting huge, and I can't remember which character means what.
- range-checking things is getting really tedious.
Troubling prognoses:
- many new commands for error checking and tuning will tax my mind even more.
- adding items to data logger will create similar pains as I'm facing with serial now.
- new functions for talking to peripherals will make things bigger.
- the optimizer will not be a good roommate; it needs its own space.
Treatment plan:
- encapsulate major types of data-structures into classes to help manage new parameters, maps, etc.
- created function templates for doing basic things on various simple data types.
- create wrapper classes to manage lists of objects and actions (think: list of serial commands, list of eeprom-backed parameters, list of logged variables)
Do you have a suggestion on program design that feels relevant to the above? Please share!
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.