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-Thread: 103376,fc52c633190162e0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!elnk-atl-nf1!newsfeed.earthlink.net!out02b.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!news-out.readnews.com!postnews3.readnews.com!not-for-mail Newsgroups: comp.lang.ada Subject: Re: why learn C? From: "Peter C. Chapin" References: <1172144043.746296.44680@m58g2000cwm.googlegroups.com> <1172161751.573558.24140@h3g2000cwc.googlegroups.com> <546qkhF1tr7dtU1@mid.individual.net> <5ZULh.48$YL5.40@newssvr29.news.prodigy.net> <1175215906.645110.217810@e65g2000hsc.googlegroups.com> <1175230352.808212.15550@e65g2000hsc.googlegroups.com> <1175236212.771445.135460@y66g2000hsf.googlegroups.com> <1175246243.5771.67.camel@localhost.localdomain> Organization: Kelsey Mountain Software Message-ID: User-Agent: Xnews/5.04.25 Date: 31 Mar 2007 13:18:22 GMT NNTP-Posting-Host: ab552c44.news.sover.net X-Trace: DXC=Ea[`RKQ1;5Y]\gY6A9AfkVK6_LM2JZB_SBVf_X`A3V\X3?@`i3kGa5[C9EeRcf@T2U6oR`23YZ=3X X-Complaints-To: abuse@sover.net Xref: g2news1.google.com comp.lang.ada:14694 Date: 2007-03-31T13:18:22+00:00 List-Id: Georg Bauhaus wrote in news:1175246243.5771.67.camel@localhost.localdomain: > If you allow me to be pedantic, SPARK is not distinguished from > Ada by external rules for programmers. Rather, it has its own > language definition, and translators that know about nothing > but the SPARK language. This approach is very different from > establishing coding rules. How is it different than using coding guidelines together with a tool that checks them automatically? I've used lint-like tools with C++ and I've found the combination effective. I express my coding guidelines in terms of which checks I enable in the tool. This is a tedious process but once done the configuration can be reused with multiple projects so it's not too terrible. Then I write programs so that the tool produces no messages. The tool essentially defines a language that is a subset of the full language. By insisting that the tool produces no messages I'm getting mechanical verification that I'm using just that subset. In some respects it's not that different from using a stricter language in the first place except that I get to define the precise subset I want to use. Using a lax language like C++ together with a configurable tool thus gives me a degree of flexibility over the case where the programming language itself specifies all sorts of required checks that I can't configure. On the other hand there is a portability issue introduced by using a third party tool. I can see that as being a major problem for programs written by multiple teams. Since Ada targets exactly those kinds of programs, Ada's approach of incorporating as much checking as possible into the standard language makes sense. I either work alone or in small groups, however, so using a third party tool is less of an issue for me. The approach I outline here is not without its problems, but it does help one write reliable programs with a lax language. I don't consider myself a genius programmer (although I do have a lot of experience with C++) but I spend very little time in the debugger. All around I appreciate Ada's approach and I enjoy working with Ada. Indeed, knowing Ada has made me a better C++ programmer. I especially like Ada's clean syntax and standards such as ASIS that make writing advanced tools for Ada easier. As you can probably guess, I'm a big believer in extending a programming language with tools. It's too bad that building tools for C++ is such a big pain in the neck. C++'s nasty syntax, together with the preprocessor, are probably the worst things about the language because they inhibit tool building. Peter