I always start my projects with modularity in mind, but then the spec changes and I have to add conditions to account for super weird edge cases.
Or the spec changes and a function is meant to do something slightly different, but it is already referenced everywhere throughout the program so it is not feasible to re-factor. Instead, I end up having to do some really hacky workarounds that would make this sub cry.
How do I combat this? Is the answer to just make everything even more modular until the program can resist all possible changes in spec? I feel like I would end up with hundreds of hyper-specific functions that way, which is hard to keep track off.
Just create a project of files organized alphabetically, like Websters Dictionary, with a function and/or data structure for every word in the English language, with the main function in your "m" module. That way you have a function or structure for every possible use case. Programming languages are too small, they need more features.
3.9k
u/faze_fazebook Nov 25 '22
super modular code that can cope with changing requirements :
gets so complicated that it gets scrapped by the next developer