News for hackers. Stuff that matters.
Re:How to Interview Engineers by zumu on Monday June 26, 2017 @08:46PM (#14641689)
If you were writing code, I would argue against using De Morgan's laws just because you can.

You're saving a few characters to make the code less obvious. Please correct me if there's some other benefit.

Re:How to Interview Engineers by justinpombrio on Monday June 26, 2017 @09:17PM (#14641843)
Usually after a mathematical simplification like this, you can find a direct explanation for it. In this case you can reason:

If two appointments conflict, that means that there is a time when they are both active. Thus each of their end times are after both of their start times. Of course, each appointment ends after it started, so that just leaves that each appointment ends after the other started. So if the appointments are a to b and c to d, then they conflict iff b > c and d > a.

(I've corrected bumbledraven's mistake of a > d vs. d > a.)

Re:How to Interview Engineers by qb45 on Tuesday June 27, 2017 @06:57AM (#14644132)
I would say, if the transformation makes the code and the reasoning behind it simpler then do it. Otherwise, know that any decent optimizing compiler can do this trick by itself so what you write only influences readability.