Performance impact of different error handling techniques

Sometimes it can make sense to check for potential errors and prevent them, instead of letting them happen.