DEV Community

Discussion on: All you need is NAND, NAND, NAND; NAND is all you need!

v613 profile image
Ceban Dumitru • Edited

You mention quick sort vs bubble sort, and importance of performance. Well can you please provide some tests where your 2 operations NAND is faster than 1 operation AND, faster than one operation OR.

You also mention DeMorgan's Theorem - "a very cool trick for making boolean code more readable"
Do you think this >> nand(nand(x, x), nand(y, y)) make boolean code more readable ?

Thread Thread
servusdei2018 profile image

I believe he is referring to boolean algebraic notation when he says it makes things more readable.

In propositional logic and Boolean algebra, De Morgan's laws are a pair of transformation rules that are both valid rules of inference. They are named after Augustus De Morgan, a 19th-century British mathematician. The rules allow the expression of conjunctions and disjunctions purely in terms of each other via negation.

Thread Thread
kallmanation profile image
Nathan Kallman • Edited

I think you're missing the point of the article Ceban. It wasn't meant to upset you.

but please don't write all your booleans using only NANDs. This is for your edification and education

Thread Thread
v613 profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Ceban Dumitru

Another useless post... edification and education - vicarious embarrassment

I can write an article about having all the code in one line, but the question (my question) is still valid: why ?
Or even better: you know when at the beginning you invert the false and the true, so later on the QA and debugging - your colleague will have a brain f..k, but again - why ?

P.S You don't have to answer, in any case it will be another excuse

Thread Thread
kallmanation profile image
Nathan Kallman

Oh no, please keep commenting; it just keeps boosting my useless post's stats! How else can I maximize this vicarious embarrassment?...