Got a bug? Check the obvious first

The title kind of says it all, but I embarras myself more than I’d like to admit by finding the cause of a bug is something so stupidly obvious that I looked straight past it and went for the holy grail uber complicated only-I-could-find-the-solution-to-this problems.This is by no means a full list of the obvious things I’ve overlooked when trying to find the cause of a problem, but it’s a decent start:

  • check the file permissions
  • check the login you’re using is correct
  • make sure you’re working on the right file
  • make sure you’re working in the right environment (e.g., you’re not modifying a local file, and checking the changes on the live server)
  • if you’re comparing values
    • trim spaces in alphanumeric values
    • if they are numeric values, make sure they are both numeric (and one isn’t a string)
  • when using integers as your field type in a database, make sure the field is big enough to hold your values (see the twitpocalypse)
  • make sure if you’re storing a string to the database… that the field isn’t expecting a numeric value…
If you’ve got some more stupidly obvious causes of bugs that you’ve seen, leave them as a comment.