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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1014db,582dff0b3f065a52 X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,bc1361a952ec75ca X-Google-Attributes: gid103376,public X-Google-Thread: 109fba,582dff0b3f065a52 X-Google-Attributes: gid109fba,public X-Google-ArrivalTime: 2001-08-06 14:40:02 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!skynet.be!louie!not-for-mail Sender: - From: Bart.Vanhauwaert@nowhere.be Subject: Re: How Ada could have prevented the Red Code distributed denial of service attack. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++ References: <3b690498.1111845720@news.worldonline.nl> <9kbu15$9bj@augusta.math.psu.edu> <9kbvsr$a02@augusta.math.psu.edu> <3B69DB35.4412459E@home.com> User-Agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (Linux/2.2.17-21mdksecure (i686)) Date: Mon, 6 Aug 2001 23:26:50 +0200 Message-ID: NNTP-Posting-Host: 194.78.202.248 X-Trace: 997134001 reader1.news.skynet.be 62251 194.78.202.248 X-Complaints-To: abuse@skynet.be Xref: archiver1.google.com comp.lang.ada:11417 comp.lang.c:72568 comp.lang.c++:80461 Date: 2001-08-06T23:26:50+02:00 List-Id: Warren W. Gay VE3WWG wrote: > Array bounds as you need them (C/C++ and Java still insist that you start > at zero and work up). (PL/I could have different bounds too). This seems a minor advantage. In fact, I consider the uniformity and advantage. Less possibility for off by one errors (did they start at 0 or at 1? I am too lazy to check, let's just assume 1, etc) > No need to know pointer context (C/C++ require obj.attr or obj->attr > depending upon what you have). The Ada compiler knows hows to do > obj.attr regardless of the context. Again, minor advantage. The compiler will warn you if you make mistakes. > Records with discriminants : Ada lets you define records (structs) with > varying size, according to the discriminant. C/C++ still must define > a char [1], and purposely work outside the array bounds to suit. For > an example, look at man msgsnd(2) (msgsnd(3) on BSD). They use the In C++ you just use virtual member funcs. Or template functions if speed is primordial. Easier, cleaner. Comparable mechanisms exist in C. > String form of enumerated values (in Ada), upon demand. In C/C++, you > must provide this for yourself. (ie. if you have C enum { Idle, > Waiting, Running } e; How do you print out the string > representation of e?) Minor advantage. Totally ofset by the fact that serious software needs internationalization anyway. If really needed, a gross #define hack does the trick. > Array slice assignment and comparison (in Ada). In C/C++, you must code > this for yourself, in loops etc. In Ada, you can assign array slices > as in A_Array(1..3) := B_Array(5..7). In C/C++, you'd have to depend > upon a function, or code a loop. Read up on the STL. It does that and more (like sticking a transformation in between, copying from stdin directly to a slice, etc...) > Attributes in Ada (like My_Array'Length). In C/C++ you must mess with the > sizeof operator (which can fool you with physical size instead of logical > size), or code it yourself with macros (constants in Java). Again, this seems mostly syntactical sugar. I don't understand the physical/logical argument. If you mean padding, it is a well understood phenomena. Anyone writing programs where padding matters, knows enough to understand the documentation of his/her compiler to straighten such issues out. > And Ada does much much more ;-) How'd I go about creating a M$-alike desktop application (after all, there is no arguing that is the largest market for software)? Time gains of being able to directly (re)use large codebases that certain (popular) platforms offer for example are more important than all your arguments mentioned above. While I am certain that Ada has bindings for some platform functionality, I am also certain they are not as complete as those for C/C++. Sure, if you are doing a defense job, it could be that the platform you need is better developed in Ada. But proposing Ada now as _the_ best solution on the basis of some (not very convincing imho) situations where ada simplifies development, is plain and simple taking one's wishes for granted. cu bart -- http://www.irule.be/bvh/