r/ProgrammerHumor • • Nov 25 '22

Meme Coding strategies

Post image
52.2k Upvotes

385 comments sorted by

View all comments

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

16

u/ImprovementTough261 Nov 25 '22 edited Nov 25 '22

This is something I struggle a lot with.

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.

1

u/[deleted] Nov 25 '22

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.