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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.28.41 with SMTP id y9mr16149901obg.14.1451215549307; Sun, 27 Dec 2015 03:25:49 -0800 (PST) X-Received: by 10.182.125.195 with SMTP id ms3mr407973obb.17.1451215549283; Sun, 27 Dec 2015 03:25:49 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!mv3no21728340igc.0!news-out.google.com!l1ni3928igd.0!nntp.google.com!mv3no15611093igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 27 Dec 2015 03:25:48 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=109.88.54.35; posting-account=6m7axgkAAADBKh082FfZLdYsJ24CXYi5 NNTP-Posting-Host: 109.88.54.35 References: <28691853-48fd-4d68-b28b-3ecbaf7a1bc0@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <677486a9-1692-4f7b-8306-1e9725ccde86@googlegroups.com> Subject: Re: Here is why C and C++ are bad... From: Serge Robyns Injection-Date: Sun, 27 Dec 2015 11:25:49 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:28888 Date: 2015-12-27T03:25:48-08:00 List-Id: On Saturday, 26 December 2015 20:21:46 UTC+1, Anh Vo wrote: > and your point is? This compiles since Natural is a subtype of Integer. O= therwise, it will be rejected by the compiler if u : New_Natural :=3D 1234;= where type New_Natural is new Integer range 0 .. Integer'Last; Thus, this = example did not demonstrate the mixing of two separate types. This is exactly my point. Using bogus examples to prove a point is a bogus = proof. If you read carefully you will notice I said "I purposely" used sub= types instead of plain types as this is what was done in the C example too= . Likewise in C++ you would have to use different classes with their opera= tors to achieve "strong" typing. I'll not be the one to dismiss all the qu= alities of Ada but I can't accept bogus arguments to paint infamy neither. = We all know it takes more than a language to build good software, it has t= o start with good software engineering and "best practices". Likewise a sa= fety belt will not make reckless drivers safe. I've given a quick look at Ramine's code as he advertised it and was surpri= sed to find plenty of type-less pointers (equivalent of void* in C), actual= ly I failed to find the traditional Pascal typed pointer notation "^type", = generic scalar types and even C like constructs like int32 and int64. Ther= e is a fair amount of design to be done in order to port the code to Ada. = Well true Ada will force him to do so, at least partially, as my example ha= s proven it. But the same will hold true if he wanted to port his code to = proper C++. And this is why I found the statement so bogus. Nothing to do= with Ada nor C++, both languages have options to do unsafe/unchecked conve= rsions and actions but all good software engineers will doubt the code.