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.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,71c743c03ed191fe X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-24 07:56:50 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!snoopy.risq.qc.ca!newsfeed.news2me.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: Beginer problem: variable array size Date: Tue, 24 Sep 2002 08:36:55 -0400 Organization: MindSpring Enterprises Message-ID: References: <1032789075.864322@master.nyc.kbcfp.com> NNTP-Posting-Host: d1.56.ba.76 X-Server-Date: 24 Sep 2002 12:37:58 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Xref: archiver1.google.com comp.lang.ada:29310 Date: 2002-09-24T12:37:58+00:00 List-Id: Not being able to speak for the prof in question, of course, but one must ask what the point of the exercise is. A "Hello World!" app is to get you to figure out how to run the compiler, etc. A "Read a bunch of numbers and sort them" exercise is probably there to teach you how to write a sort. Getting bogged down in side issues like how to properly design the input so that no ingenious and abusive user can possibly cause it to crash is *probably* not the point of the exercise. In a class on abstract data types, etc. I might give an assignment with the objective being "Learn how to use dynamic allocation and the creation of linked lists" - but then it would be cheating to say "Well, the language already gives it to me, so I'll use that..." I just don't think that a case can be made that putting some kind of arbitrary limit on input for a student exercise because the language doesn't give you a convenient, easy way of otherwise handling it is a bad thing. It's a _student_exercise_ - not a production piece of code. 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] ====================================================================== Hyman Rosen wrote in message news:1032789075.864322@master.nyc.kbcfp.com... > > In modern computing environments, programs that take input > from the user are easily hooked up to take input from other > programs or files instead, so working on the assumption that > the program will be used only by a human typist is foolish. > The professor probably has files of input numbers that will > be fed to each submitted program. I'll bet one of them is > very large, to test the input size limit even if the sort > won't complete in a reasonable amount of time. > > Furthermore, if you are going to have an arbitrary limit, > you have to provide the extra code to handle the case of > the limit being exceeded. I suppose you could just range > over the size of the array and ignore any extra input. This > is exactly the kind of silently wrong behavior I was talking > about. > > And further yet, why do you think you get to rewrite the > given requirements just because they don't suit the style of > your favorite programming language? >