I read that the ‘if’ keyword is evil, and better to use predicate to replace if. Then I googled, but still dont get it.
Can anyone be kind to provide an example?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No matter what they say, if is not evil. There may be specific cases for which a Predicate is a better choice than an if (or a set of ifs).
For example,
versus (.NET 2.0)
or (later)