From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,54c513170bafd693 X-Google-Attributes: gid103376,public From: Paul Graham Subject: Re: Desirability of C++ Date: 2000/05/03 Message-ID: <391060A6.7ABCDCFE@cadence.com>#1/1 X-Deja-AN: 618772438 Content-Transfer-Encoding: 7bit References: <390DEC7F.9429C82C@online.no><390E2A20.B647D0D6@maths.unine.ch> <8em8mb$evd$1@wanadoo.fr><390EEF24.BD36AA24@maths.unine.ch> <8eonat$sqj3@ftp.kvaerner.com> <8eoo6v$ers$1@wanadoo.fr> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Cadence Design Systems Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-05-03T00:00:00+00:00 List-Id: Pascal Obry wrote: > Even to compare two strings you have to write: > if (strcmp (name1, name2) == 0) { > ... > I do prefer: > if name1 = name2 then > ... Just because the standard library provides a somewhat unreadable function like strcmp doesn't mean you have to use it directly. In C you can write: if (StrEqual(name1, name2)) { ... assuming an appropriate definition of StrEqual. You can also write: if (StrIEqual(name1, name2)) { ... for case-insensitive comparisons. How do you compare strings case-insensitively in Ada? By writing a routine like StrIEqual, in which case you lose the notational ease of '='. Paul