Should I use AND or should I use OR

Posted by BDotA on Programmers See other posts from Programmers or by BDotA
Published on 2012-10-29T16:39:49Z Indexed on 2012/10/29 17:21 UTC
Read the original article Hit count: 222

An order can be in the "status" of Completed, Corrected or some other stratus. I saw some code that is checking it like this, the purpose is to disable some stuff when the status is in Completed or Corrected status.

 if (model.CurrentStatus != DSRHelper.OrderStatusEnum.Complete && model.CurrentStatus != DSRHelper.OrderStatusEnum.Corrected)

I can't get it why the engineer has used "AND" for this, shouldn't it be an "OR"?

© Programmers or respective owner

Related posts about conditions

Related posts about programming-logic