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,bd45e29f9dafca87 X-Google-Attributes: gid103376,public From: Brian Rogoff Subject: Re: bitwise comparators Date: 2000/02/07 Message-ID: #1/1 X-Deja-AN: 582816507 References: <3880D375.7E363123@hotmail.com> <38829638.0@news.pacifier.com> <3882FC1C.2BA8C959@hotmail.com> <389C4F0D.E5541B98@earthlink.net> Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: nntp1.ba.best.com 949957744 218 bpr@206.184.139.136 MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-02-07T00:00:00+00:00 List-Id: On Sat, 5 Feb 2000, Ashley Deas Eachus wrote: > Brian Rogoff wrote: > > > C is also my primary language, and at the risk of annoying Robert Eachus :-), > > let me add "nested subprograms" to your list. And the ability to have local > > arrays whose dimension depends on a local or parameter. And ... > > No annoyance, or maybe a little in the terminology. ;-) I specifically > distinguished between nested procedures and nested functions. But the fact that > most nested procedures in Ada indicate design flaws does not mean that nested > procedures are not a very powerful feature in Ada. Quite the opposite. Hmmm, I'll have to go back and look, or simply ask you to expand on this, since from what follows I must have misunderstood your position. The time I *really* rely on nested procedures is when I'm instantiating a nested procedure as a parameter of some generic subprogram, and simulating downward funargs. Its rare that I feel I need them, and probably worse for me than for some others since it can be argued that I'm programming FP style in Ada. > My complaint, if you can call it that, it that nested procedures in Ada are a > great design abstraction. However, when the design is realized, almost all such > procedures should be transformed into more appropriate constructs. Don't use a > sledgehammer to swat flies. Of course, many of the abstractons that the nested > procedure can be specialized to are also powerful. In fact, nested generic > procedures are more like an M1A1 tank. Unlike nested procedures however, they are > not overused... I think if Ada had a better way to do downward funargs (like Bob Duff's limited access to subprogram) I would have much use for nested generic procedures any more. > > I agree with Alexander that Ada is a larger language and to learn all of > > its features is much harder than to learn all of the features of C, but > > I've found it a much more rewarding language as well. If you're > > comfortable with C, just start with the C level subset of Ada and add > > knowledge as you need it. With Ada 95, you really do have all of the > > features of C worth having. > > Ada was designed to favor readers over writers, and a lot of the > "duplicate" features are for just that purpose--to allow the author to better > communicate his intent to the reader of the program. Part of the pressure on > authors to favor the reader is that code that sends the wrong message looks ugly > to good Ada programmers, so you will see lots of discussion here of the "best" > way to implement some abstraction, even though all of the proposed language will > probably generate identical machine code. So take discussions here about while > loops vs. exit statements--and my comments about nested procedures--with a large > grain of salt. OK, but I'm still interested in why people prefer one style to another, and even if I'll often disagree (suffixes on types, use clauses, etc.) I find it important to understand the reasons for certain preferences. -- Brian