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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bd45e29f9dafca87 X-Google-Attributes: gid103376,public From: "DuckE" Subject: Re: bitwise comparators Date: 2000/01/18 Message-ID: <38852412.0@news.pacifier.com>#1/1 X-Deja-AN: 574510346 References: <3880D375.7E363123@hotmail.com> <38829638.0@news.pacifier.com> <3882FC1C.2BA8C959@hotmail.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Trace: 18 Jan 2000 18:40:18 PST, 216.65.141.142 X-MSMail-Priority: Normal Reply-To: "DuckE" Newsgroups: comp.lang.ada Date: 2000-01-18T00:00:00+00:00 List-Id: Alexander Van Hecke wrote in message news:3882FC1C.2BA8C959@hotmail.com... > > I'd also like to point out that the "while" construct you are using is > > common for 'C' or Pascal, but in Ada you could use a "loop" construct with > > "exit when" > > > > thank you all for your response! > As many of you have pointed out, I could have used exit when ... > But as you probably noticed, I have a C background and I'm not that familiar > with Ada. I think it's a nice feature of Ada that you can write 'readable' > code, but IMHO Ada takes a lot longer to learn, there are more constructs, > keywords, etc... In a word, the language is more complicated, yet not > necessarily more powerfull (hope I don't get flamed for this :-)). In C you'd > have one while loop, and you'd put your condition in the while expression and > that's it. Nothing more to learn about it! > What's your opinion on this? > > alex > I've done projects in both C and Ada, and when given a choice on a new project I choose Ada. Yes it takes a while to learn all of the nuances of Ada, but the same is true of C. There are numerous bugs I have run across in C programs that have been a bear to track down, that are very visible in Ada. Here's a few examples: for( i = 0 ; i < 10 ; i++ ); { printf( "Value of i is %d\n", i ); } Gives the output: Value of i is 0 To "spot the bug" here's the equivalent Ada code: for i in 0 .. 9 loop end loop begin ada.text_io.put( "Value of i is " ); ada.integer_text_io.put( i ); ada.text_io.new_line; end; An experienced C programmer might see that extra semicolon instantly when looking at the source code, but when digging for a needle in a haystack in a large body of existing code, I personally can do without this kind of trap. There are several other examples of simple C coding errors that can trip you up, but you probably get my point. SteveD