Sender: mcowan AT mcowan-linux DOT transmeta DOT com Newsgroups: comp.lang.c++,comp.os.msdos.djgpp Subject: Re: Making C++ little easier to beginners... References: <9qmkrh$581$1 AT tron DOT sci DOT fi> From: Micah Cowan Message-ID: Lines: 43 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Organization: Transmeta Corporation Cache-Post-Path: palladium.transmeta.com!unknown AT mcowan-linux DOT transmeta DOT com X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/) Date: 19 Oct 2001 12:06:48 -0700 NNTP-Posting-Host: 209.10.217.66 X-Complaints-To: news AT globix DOT net X-Trace: news.sjc.globix.net 1003518410 209.10.217.66 (Fri, 19 Oct 2001 12:06:50 PDT) NNTP-Posting-Date: Fri, 19 Oct 2001 12:06:50 PDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Traveler" writes: > Little example... > > int x = 10, > y = 10; > > if(x == 10 && x == 10) // Does this look scary or weird to you ? > cout << "true\n"; > else > cout << "false\n"; > > > wouldnīt this be nicer ? > > if(x EQUAL 10 AND y EQUAL 10) > cout << "true\n"; > else > cout << "false\n"; > > Hereīs little helper... > > #define AND & > #define COMPLEMENT ~ > #define EQUAL == > #define EQU EQUAL > #define NOT ! > #define OR | > #define XOR ^ > > As you can see the things "AND" & "OR" defined here are "bit" operators not "logical" operators. > However, there really is no difference becourse you can use these two just as easily in "if" statementīs as in bit manipulation. > > All calculations done in computer, from the simplest addition to the most complex 3rd grade (or greater) root solving uses these operatorīs and their compinations inside the microprocessor. Your recommendations are completely unhelpful, since C++ *ALREADY* has similar (better, in fact) token alternatives. Some people prefer them; most don't. Because someone who is familiar with the language is equally capable of understanding either; and in fact, sometimes the shorter versions are easier (quicker) to read. Micah