English binary logic operators

Daniel Keep daniel.keep.lists at gmail.com
Thu Nov 9 18:31:22 PST 2006



Hasan Aljudy wrote:
> ...
> ummmm .. mathematicians use more complicated symbols and notations than
> programmers.

It's funny; but the early programming languages were designed by
mathematicians.  Trust me, if they'd been able to use ∧ for and, and ∨
for or, they would have :)  On a few systems, they actually *did*.  I
think programmers use "simpler" notation simply because we're limited to
what we can bang out on a keyboard, and mathematicians aren't.

(In fact, mathematicians seem to *love* inventing new symbols: the guy
who invented lambda calculus originally wanted to introduce a new
symbol.  But when it was sent off to be published, the typesetter
mistook his new symbol for a lambda (λ), and it kinda stuck :P)

Incidentally, I think the symbols used in mathematics are better if
they're available since they're pretty unique, and stand out even
better.  An interesting thing to try is writing up some CWEB code: it
converts all the &&s and ||s to ∧s and ∨s in the TeX documentation :3

> ...
> I actually like symbols in code because they stand out right away.
> I always prefer {braces} to begin/end.
> At the same time, I hate too many symbols too close to each other.

I prefer using names if the names are short and meaningful.  It makes
code that little less cryptic.  As long as you don't end up with insane
symbols like #!@$? actually *meaning* something, it all works either way.

Similarly, one of the reasons I hate Java is because
everyIdentifierIsACompleteAndGrammaticallyCorrectSentence
.justBecauseTheyCan(andItMakesWritingLongExpressionsInJava
.aTotalPainInTheArse)

Ah well, each to their own, I suppose.

	-- Daniel

-- 
Unlike Knuth, I have neither proven or tried the above; it may not even
make sense.

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D
i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/



More information about the Digitalmars-d-learn mailing list