I’ve talked about not repeating yourself before and just like a certain holiday, I’m going to repeat myself. In the movie GroundHog Day Bill Murray’s character is forced to repeat the same day over and over again. It isn’t until he begins to find a way to improve the day does he finally get to move on. As a viewer, we never know how many times he repeats this day, other than he was locked in this loop for weeks, if not years.
As a developer, it is important to not repeat the same unsuccessful ideas. If something isn’t working instead of just trying little changes with the hope that it will solve the problem, take the time to figure out why the problem is there is the first place. It might be something quick and easy to fix, but it might also be a fundamental problem that will require a more involved solution.
But, the important part is that each step should be bringing you closer to a solution. But, you won’t find that solution until you know what is causing the problem.
This also requires taking the time to know your code and the language that it is written in. Is the problem simply you misunderstanding something? Is the problem your solution being wrong? Is the problem simply a typo or a greater than that should have been a less than? If you understand the problem, then these solutions will likely become obvious. It also helps if your code is well designed and modular. That way you can test smaller parts of the program to see where the actual problem lies.
Yes, I did repeat advice from the past, but when you put the parts together they often lead to a quick solution to whatever problems you might be having.