comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <mcondic.auntie.spam@acm.org>
Subject: Re: Beginer problem: variable array size
Date: Fri, 20 Sep 2002 08:11:11 -0400
Date: 2002-09-20T12:16:07+00:00	[thread overview]
Message-ID: <amf3i7$v68$1@slb5.atl.mindspring.net> (raw)
In-Reply-To: 38993b18.0209191906.b56b982@posting.google.com

I'll agree with the "Hello World" example, but I've never seen the second
one you cite as an example in a programming class. (Usually, the second
program is "Read in two numbers and add them together...") And its a bit
unfair to pull an example out like this and say "C++ can do this in N lines
and it will take 10*N lines in Ada..." One can *always* rectally extract an
example that makes language X look bad and language Y look good.
(Illustration: "Reduce an N by M matrix of numbers..." - In some languages
this can be done in one instruction. How many instructions does it take in
C++?)

The reality is that by putting a requirement out there that there must be no
limit on the number of elements accepted, you create a difficulty that
doesn't normally exist in the real world. The fact that I can't dynamically
grow an array in Ada without building my own data structure isn't in
practice going to prevent me from accomplishing a job. I just build the data
structure or redefine the problem such that I can do it with a fixed data
structure. Arrays in C++ can't dynamically grow either - you require a data
structure that is built from the primitive ones. So C++ already has it built
and that's nice, but its not something that can't readily be duplicated in
Ada.

If the problem is one of "How do I get my job done..." then the answer is to
get hold of one of the many spiffy Ada libraries out there that will provide
dynamic data structures. If the question is "How come Ada doesn't have any
standard dynamic data structure libraries that ship with every
compiler???" - well, I've been asking that question here for some time now.
:-)

BTW: I'm waiting for Ada to have some standard matrix & vector libraries so
I can post to C++ newsgroups "Why can I multiply two matrices together in
Ada in only one line of code and it takes me ten thousand to do it in
C++..." :-)

MDC
--
======================================================================
Marin David Condic
I work for: http://www.belcan.com/
My project is: http://www.jast.mil/

Send Replies To: m c o n d i c @ a c m . o r g

    "I'd trade it all for just a little more"
        --  Charles Montgomery Burns, [4F10]
======================================================================

Munch <ramunch@sigecom.net> wrote in message
news:38993b18.0209191906.b56b982@posting.google.com...
>
> The problem is:  Prompt the user to enter in an Integers followed by
> pressing <enter>, enter a 0 to terminate.  At no point have a set
> ceiling on how many integers can be in the array.  Sort using whatever
> sort algorithm makes you happy then display.
>






  parent reply	other threads:[~2002-09-20 12:11 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-15 14:53 Beginer problem: variable array size Nacho
2002-09-15 16:45 ` Larry Kilgallen
2002-09-15 16:16   ` Nacho
2002-09-15 16:26     ` Ludovic Brenta
2002-09-15 17:46     ` Jeffrey Carter
2002-09-15 18:27     ` Pascal Obry
2002-09-15 20:03     ` Larry Kilgallen
2002-09-17 14:22     ` Ted Dennison
2002-09-18 11:53       ` Marin David Condic
2002-10-02 15:08         ` Matthew Heaney
2002-10-03 12:17           ` Marin David Condic
2002-09-19  0:43     ` Robert A Duff
2002-09-19  1:25       ` Jeffrey Carter
2002-09-19 14:17       ` Hyman Rosen
2002-09-20  3:06       ` Munch
2002-09-20  4:49         ` Jim Rogers
2002-09-20  6:35         ` tmoran
2002-09-20 16:00           ` Pat Rogers
2002-09-20 16:07             ` Preben Randhol
2002-09-20 20:15               ` Pat Rogers
2002-09-20 12:11         ` Marin David Condic [this message]
2002-09-20 13:59           ` Larry Kilgallen
2002-09-20 14:55             ` Hyman Rosen
2002-09-20 16:10               ` Larry Kilgallen
2002-09-20 16:31               ` Warren W. Gay VE3WWG
2002-09-24 12:41                 ` Thomas Dickey
2002-09-21 10:44               ` Thomas Dickey
2002-09-23 13:37                 ` Hyman Rosen
2002-09-22 13:00               ` Marin David Condic
2002-09-26  3:37                 ` Kevin Cline
2002-09-26 12:42                   ` Marin David Condic
2002-09-22 12:49             ` Marin David Condic
2002-09-20 16:28           ` Warren W. Gay VE3WWG
2002-09-20 17:49             ` Hyman Rosen
2002-09-21  7:30               ` Preben Randhol
2002-09-23 13:41                 ` Hyman Rosen
2002-09-22  3:34               ` Ted Dennison
2002-09-22 13:18             ` Marin David Condic
2002-09-24 16:55               ` Warren W. Gay VE3WWG
2002-09-25 12:06                 ` Marin David Condic
2002-09-21 22:23           ` tmoran
2002-09-23 13:53             ` Hyman Rosen
2002-09-23 15:19               ` Chad R. Meiners
2002-09-23 16:00                 ` Hyman Rosen
2002-09-23 17:09               ` tmoran
2002-09-23 18:18                 ` Hyman Rosen
2002-09-23 19:53                   ` tmoran
2002-09-23 20:32                     ` Hyman Rosen
2002-09-23 20:10                 ` Dennis Lee Bieber
2002-09-23 23:09                   ` tmoran
2002-09-24  2:33                     ` Dennis Lee Bieber
2002-09-24 12:36               ` Marin David Condic
2002-10-02 15:13       ` Matthew Heaney
2002-09-19 20:25     ` Brian Gaffney
2002-09-17 10:20 ` Georg Bauhaus
2002-10-02 15:04 ` Matthew Heaney
2002-10-02 16:26   ` Preben Randhol
2002-10-02 19:53     ` Matthew Heaney
2002-10-03 12:31       ` Marin David Condic
2002-10-03 15:15         ` Matthew Heaney
2002-10-21 23:38           ` Matthew Heaney
2002-10-22 14:11     ` Matthew Heaney
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox