The Visual Studio IDE gives the developer almost instant feedback as to whether or not a block of code is correct or a program runs correctly. This usually leads to programming by guessing... The programmer thinks to themselves, "Maybe the intellisense will tell me it's right if I do it like this..." or "Maybe if I change this constant to that or change this loop and click play it'll work..."
I usually fall into this mode when I'm tired or have my mind on other issues (i.e. just don't care ATM). It's sometimes hard to break out of this "mode of operation" because you want to get something done but at the same time you aren't thinking about what you're doing. It's a viscous cycle.
What are some causes of this type of programming and how do you recognize (i.e. catch yourself) when you've fallen into this trap and correct it? Or perhaps a better question, how do you prevent it?
(I'm referring more to writing new code or getting a block of code to work than debugging existing code, although it could apply to debugging existing code too.)
Think instant gratification.