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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!fx28.iad.POSTED!not-for-mail From: Brad Moore User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: How to get nice with GNAT? References: <969708583438656051.436159nonlegitur-futureapps.invalid@reader80.eternal-september.org> <0d085a5a-d4ac-4506-ae5f-8da685f39004@googlegroups.com> <1ukyfvaqgkwo1.6ngfx1v21twz$.dlg@40tude.net> <1g5ttpzi8eywc$.1gluj9evlmeus.dlg@40tude.net> <1adpj5cs8xtkf$.hqv9tsofbfgz$.dlg@40tude.net> <1hrw1i0f6nyde.1obvidset2kfc$.dlg@40tude.net> In-Reply-To: <1hrw1i0f6nyde.1obvidset2kfc$.dlg@40tude.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 68.145.219.148 X-Complaints-To: internet.abuse@sjrb.ca X-Trace: 1418141659 68.145.219.148 (Tue, 09 Dec 2014 16:14:19 UTC) NNTP-Posting-Date: Tue, 09 Dec 2014 16:14:19 UTC Date: Tue, 09 Dec 2014 16:14:20 -0700 X-Received-Bytes: 3311 X-Received-Body-CRC: 1754367604 Xref: news.eternal-september.org comp.lang.ada:23923 Date: 2014-12-09T16:14:20-07:00 List-Id: On 2014-12-09 1:51 AM, Dmitry A. Kazakov wrote: >>> Which is using Ada as if it were C. The combinations of objects should be >>> handled in a way allowing to map combinations onto the language items >>> allowing static checks. Yes, it is not always possible, and where not >>> possible it becomes a C program in Ada, partially of course. >> >> Not at all. C has no run-time checks; you'll never get any sort of error >> from it unless you write it explicitly yourself. I'm never going to have >> enough fortitude to write thousands of pages of checks by hand; I've got to >> have language support to make those checks. > > Yes, but we are discussing bugs, not errors. When you say that an exception > manifests a bug, then C is as good as Ada. The same bug in C will show > itself differently, but so what. The "so what" is a monumentally huge difference in my experience. Aside from C not having exceptions, having an exception flag an error at the site of the violation can make it much easier to notice and fix the bug. Since it is typically not practical to write all these checks by hand in C, it is not uncommon that the program can continue to execute considerably past the bug until some undesirable behaviour is eventually noticed as a result of a growing snowball effect. For instance, in C you might end up with some strange memory corruption as a side effect of the original bug, which may or may not be easy to reproduce, but often can be extremely difficult to debug. A memory corruption problem may not always cause a failure, and may not be actually noticed until a system has been deployed. An unhandled exception in Ada however results in the program ceasing execution, so it is more likely that the bug will be noticed earlier, possibly before deployment, which can be far less costly.