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.8 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!crdgw1!jupiter!kassover From: kassover@jupiter.crd.ge.com (David Kassover) Newsgroups: comp.lang.ada Subject: Re: Problems/Risks ... Message-ID: <5519@crdgw1.crd.ge.com> Date: 25 Feb 90 20:11:36 GMT References: <12568231436.32.MOESTMANN@WSMR-SIMTEL20.ARMY.MIL> Sender: news@crdgw1.crd.ge.com Organization: Aule-Tek, Inc. List-Id: In article <12568231436.32.MOESTMANN@WSMR-SIMTEL20.ARMY.MIL> AMXMC-SEL@WSMR-SIMTEL20.ARMY.MIL (Mark Oestmann) writes: > >AS PERTAINS TO THE Ada 'GOTO': > >It is not needed. Our Software Engineering program is one year in length >and has Ada as the core language. The students do not hear the word 'GOTO' >as pertains to Ada until the day of graduation. My parting shot to them is, >"By the way, Ada does have a 'GOTO'. Don't use it." > Oh wow. Another structured programming debate. Sorry, I'm showing my age 8-). Eliminating the GOTO does not eliminate all unconditional transfers from Ada. Ada is functionally complete without the GOTO. There is no program that could not be written without it. BUT in some circumstances the cost of programming around the unconditional transfer is high. (Retesting a condition? when that condition is REAL-TIME and not likely to be in the same state? Reading to the end of a 40 Gigabyte data set (don't laugh, please, such exist) when it is already determined that such is futile?) There are GOTOs in my Ada code. A lot less than there would be if I were using FORTRAN. But I use them carefully. Textbook cases used for pedagogical purposes are generally very simple when compared to many real life programs. Ignoring the "hard" or "pathological" cases is not a good way to go. Hmm. I'm away from my Kernighan and Ritchie. But doesn't C have a GOTO statement, too? Not to mention the trinary operator, which helps produce unreadable one-line wonders, and by the way, compiles into inferior machine code using VAX C. (inferior to just writing out the IF-THEN-ELSE like normal people (only have a grin here))