I had a few days ago. I was having trouble with threads. Had lots of questions asked on StackOverflow and honestly for the first time I did not get the answer I was looking for. Finally, I decided to do a huge re-design of my system code and magically within a few hours I found a solution. So my question is, is it normal to often do a re-design if I get stuck with a problem or should I push on hard till I find a solution? Mind you this is the first time I was stuck for this long on a piece of code.
How long does one have to wait to consider design change in code?
design patterns;architecture;programming practices;refactoring
Is there a specific reason to stick with the original solution? i.e. Backwards compatibility, other part(s) are reliant on that configuration, etc.? If not, I would say that's part of the normal design process.Personally, just on a simple project I'll find myself refactoring either design or implementation until I've found a solution that works, but also is more efficient (the former being the most important) [red, green, refactor].Take a more basic approach; Should you solve a problem in ASP.NET and keep brute-forcing problems, or move to [e.g.] perl where a library available would make it very simple to design? If the project doesn't have any other complications it probably makes sense to move to something that would make your life easier (as long as it meets the needs of the original project). However if, for example, the rest of the site is in ASP, it would stand to reason you would keep working on a solution instead of shifting the whole site over because of one problem (even at the expense of additional days of problem solving).