Code should be written so that it is understandable by other professional programmers, not people who started programming two weeks ago.
Code should be written so that it is understandable by other professional programmers, not people who started programming two weeks ago.
People who only start coding for two weeks can't understand any code.
People who start has enough experience to work, but only start in this project for two weeks, will understand "!!" idiom.
> I would leave a note to a student for using this to be honest - too unclear, and (as this thread denotes) not well known enough to put in production worthy code.
You've done a total disservice to your students that understood negative unary operations then. Given how many upvotes my initial post on this thread has (currently 38) I don't think the thread denotes what you think it does at all.
The '!!expr' is the idiom most people use whenever the need for a canonical 0/1 representation arises.