if statement examples and best practices