title: When debugging, how do you estimate if you should rewrite or keep looking?
body: <p>You have all met this scenario. I am using a new algorithm for the first time, and I am sitting at my computer trying to find out if it is some syntax problem or if I have misunderstood the algorithm. In a scenario like this, I would sooner rewrite the program than spend time staring at the screen. But this raises the general question, that I am curious to hear from programmers more experienced than myself:</p>
  
  <p>How do you judge when it is the right time to rewrite, or should you continue sitting there staring at your code looking for the bug?</p>
  
  <p>Are there any useful heuristics that professional programmers use? </p>