English binary logic operators

antonio antonio at abrevia.net
Thu Nov 23 13:26:39 PST 2006


Ary Manzana wrote:
> Bill Baxter escribió:
>> David Qualls wrote:
>>> I just compiled my first D function (adapted from C), and had to
>>> replace all my 'and' 'or' and 'not's with the arcane &&, ||, and !
>>> from prehistoric C to get it to compile.
>>>
>>> iso646.h has been a part of C for several years.  Perl, C++ and
>>> possibly other languages have all adopted 'and', 'or', and 'not'
>>> as part of their grammar.
>>>
>>> I write software that will be maintained by non-programmers
>>> (mathematicians, who would prefer that I use Fortran).  Lots of
>>> funny symbols in source code (like && || !) make it difficult to
>>> read for the non-immersed (ah, who am I kidding, I even have
>>> trouble reading it now and then).
>>>
>>> Is there any future to D incluing the logical operators in
>>> English, as opposed to &!|%'ish?  (I didn't mention it, but 'mod'
>>> might also be a good (easy for non-programmers to understand)
>>> substitute for '%'.)
>>>
>>> David
>>
>> +1
>>
>> After 20 years of C/C++ my use of && and || was pretty instinctual, 
>> but after just a few months of working with Python on the side I found 
>> I started typing 'and' and 'or' without thinking about it.  It makes 
>> complicated expressions more readable and would fit in great with D's 
>> more "modern" look.
>>
>> As noted before, I'm also in favor of allowing 'in' to replace ';' in 
>> foreach statements.
>>
>> --bb
> 
> I guess the main reason to stick with symbols is some compatibility with 
> C/C++ source code.
> 
> Anyway, I also like the idea of words instead of symbols. You benefit 
> from readability and it's also much more simpler to type (i.e. you don't 
> you shift or look in a new keyboar for them).
Well..

I'm an spanish programmer:

   My code is written using Spanish terms like "valor" vs "value", 
"irSiguiente()" vs "goNext()"...

the best of algebra symbology is the language independence:

	[x..y] vs "Between x and y"
	x < y  vs "x less than y"
	a.b    vs "the b of a"  (Director Lingo used this sintax)
	(a)b	vs "cast b to a"
	a = b  vs "set value of a to value of b"
	a == b vs "a equals to b"
	{ stamens } vs "begin stamens end"
		

I'm forced to use the basic english programming syntax: if/else, while, 
for, foreach, public, private, protected,.... PLEASE: STOP IMPOSING 
ENGLISH TO THE WORLD... you are not the only one programming here.

thanks
Antonio



More information about the Digitalmars-d-learn mailing list