How to program like Pete:

  1. SQL Errors don't happen.
  2. Don't comment. But if you do, just do something like:
    //this one is tricky
  3. If you make dynamic progress bars, make the text labels for each step identical for all the bars. This is because useful information should be teased, but never given.
  4. Make sure the progress bars are guaranteed to get to the second to last step. No errors should be noted until the very last step. It might even be okay to throw out all errors up until then.
  5. Then regardless of whether everything worked perfectly or if any failures were noted, immediately redirect to the next page.
  6. No one will never need to go back to a previous step in an installation process. If anyone does need to go back to a previous step, force them to edit the MYSQL tables by hand.
  7. For the love of god, don't tell anyone if the code produces an error that could bring the server down.
  8. Tis better to worry about whether your variables have capital letters in them than to worry about the functionality of your code.
  9. If anyone asks you to explain anything, distract them with an irrelevant talk on the history of djbdns and its author.
  10. Documenting your work is simply a matter of printing up unix man pages for the systems and software that you worked with.

How to error check SQL statements like Pete:

  1. Errors are a myth.
  2. Ignore errors with @mysql_query()
  3. Don't ignore the error, but don't bother check for it with mysql_error()
  4. Echo the error (echo mysql_error()), but then continue on with normal program execution as if nothing bad happened.
  5. Pretend to check if an error occured, but don't really.
    if (mysql_error() or true) { ... }
  6. Check if an error occured, and set a variable with the error message, but then just end the program without ever displaying the message.
  7. Check if an error occured. If one did then just try the exact same SQL statement again, but this time don't check for an error.    »«    home