O'Reilly logo
  • Eihab Hala thinks this is interesting:

Rules for If-Statements

1. Every if-statement must have an else.

2. If this else should never be run because it doesn’t make sense, then you must use a die function in the else that prints out an error message and dies, just like we did in the last exercise. This will find many errors.

3. Never nest if-statements more than two deep and always try to do them one deep. This means if you put an if in an if, then you should be ...