Is there any difference (performance-wise, for example) between
<cfif not x EQ y>
and
<cfif x NEQ y> ?
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.
If there is any difference at all, I’d doubt you’d notice it unless you are running this many, many, many times or unless x and y are really processor intensive somehow. I’ve never seen this flagged as a possible performance issue with Coldfusion since MX 7.
I would recommend using the format that is the most readable to you. Adding bugs to your code by making it hard to read will be more of an impact than the performance differences of these two formats.
Personally, I’d prefer to see the NEQ version as it reads better and is more common in CF.
In my head reads, “If x not equal to y…” Whereas….
reads “if not x equal to y…” doesn’t make sense in English.