Image from the legendary adventure game Monkey Island 2 – remember to visit Grumpy Gamer – The personal blog of Monkey Island creator, Ron Gilbert. Fine place for adventure gamers is justadventure.com, check that as well.
Recently I had coded for several hours and it was 6 pm. I had just finished a piece of SQL code and it seemed to work… until I noticed that DELETE record was not working, but there was no error message.
I made the every possible thing I could imagine:
- double checked the query string – was ok
- checked the field names in db several times… all okay
- I added debug info… everything seemed ok
- I searched for any error… nothing – all was ok
- I went through all the variables… no errors there
- I cursed (didn’t help)
- I repeated all this over and over and tried to tweak something here and there… didn’t work.
I decided to finish for the day. I had woke up at 6 am and I was bit tired. I decided to continue tomorrow.
The next day it took me about 1 minute to locate the error. I made a simple test (used bit different variable content) and it was there. The error was not in the syntax, but in the content.
I’ve noticed same thing happen me years ago when I played lots of adventure games. I had played the game for hours and tried to find the solution for the problem, but without any luck. But… after a night’s sleep and with fresh brain – the solution is apparent. I recommend you to do the same: If sometimes you feel you cannot solve a problem and you feel tired – go to sleep and let your brain solve the problem while at sleep. It just might work.