07-10-2006 11:54 AM - edited 07-10-2006 11:54 AM
Have you ever used the Implies function? It's on the Boolean palette:
Every once in a while I'm writing conditional code that needs to execute as follows: If X is True and Y is False, do something. For all other cases, do something else. When I'm writing this kind of code, I always reach for Implies. When I see it on my diagram, it's always immediately clear to me what's going on...which is good, since Boolean logic was never my strong suit.
-D
P.S. - Check out past nuggets here.
Message Edited by Darren on 07-10-2006 11:54 AM
07-10-2006 12:16 PM
07-10-2006 12:18 PM
07-10-2006 12:32 PM
07-10-2006 12:57 PM - edited 07-10-2006 12:57 PM
Message Edited by altenbach on 07-10-2006 10:58 AM
07-10-2006 01:47 PM
Yup, but when I see Implies on the diagram, it's immediately clear to me that "oh, here's a situation where I'm looking for a specific T/F combination of these two Booleans." That's not as clear to me if I see a Compound Arithmetic set to Or with one of the inputs negated. 🙂
Of course, I'm no computer scientist...perhaps the latter is more understandable by those hooligans. 😉
-D
07-10-2006 04:30 PM
07-11-2006 10:44 AM
Different strokes for different folks I guess. I consider the "implies" operator to be nifty but overly obscure.
I actually have used the "Implies" primitive a few times, but have lately been making an intentional habit of preferring the compound Bool arithmetic. To *me*, the negated input reads more literally. ((~A) OR B) seems more intuitive than (A-->B). Especially if I'm trying to explain it to anyone who hasn't studied formal logic.
I've learned and accepted the idea that an 'implies statement' with a False premise will always evaluate to True, but I've known quite a number of people who just can't seem to grok it. Granted, they typically aren't people who look at source code, but for me it seems simpler to stick with the basic AND, OR, NOT stuff when feasible.
Not looking to proselytize, just adding my 2c.
-Kevin P.
07-11-2006 10:55 AM - edited 07-11-2006 10:55 AM
@Kevin Price wrote:
..., but I've known quite a number of people who just can't seem to grok it.
I have to admit that every time I used "implies" so far, I had to do a double-take on the context help to make sure I don't mix up the x and y inputs, since they are not interchangeable. 😮
(Of course we can just blindly hook it up, then use the switcheroo trick from an earlier nugget to swap away until the results are as expected ;)).
Using the compound node, you can have the inverted input on the top or bottom, and it is always clear what's what. 😄
Message Edited by altenbach on 07-11-2006 08:56 AM
07-11-2006 11:05 AM