2 ms·
A lot of programming maxims like "stay DRY" are rules of thumb, and often are dangerous, or at least lead to unexpected results when treated like laws of nature
by indymike 6y ago
A lot of programming maxims like "stay DRY" are rules of thumb, and often are dangerous, or at least lead to unexpected results when treated like laws of nature. I had a developer who drank functional flavored Koolaid and refactored any single line of code that appeared more than once in an application. Was about 38K lines of code. When he was done, it was still about 38K lines of code. Was it functionally pure? yes. Was it very difficult to debug? Yes... you had to step into sometimes five or six functions to get to a single line of logic.
- bluetwo 6y agoI agree. I also think that when building a prototype, flexibility is more important than stability. I allow myself to repeat code when I think two similar things will be different by the time requirements are better known. Later I'll usually re-write in a more stable fashion.