comp.lang.ada
 help / color / mirror / Atom feed
From: Serge Robyns <serge.robyns@gmail.com>
Subject: Re: Here is why C and C++ are bad...
Date: Sun, 27 Dec 2015 03:25:48 -0800 (PST)
Date: 2015-12-27T03:25:48-08:00	[thread overview]
Message-ID: <677486a9-1692-4f7b-8306-1e9725ccde86@googlegroups.com> (raw)
In-Reply-To: <cd805655-859c-419b-ad42-3101ae8a6d2a@googlegroups.com>

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. Otherwise, it will be rejected by the compiler if u : New_Natural := 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 operators to achieve "strong" typing.  I'll not be the one to dismiss all the qualities 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 to start with good software engineering and "best practices".  Likewise a safety belt will not make reckless drivers safe.

I've given a quick look at Ramine's code as he advertised it and was surprised to find plenty of type-less pointers (equivalent of void* in C), actually I failed to find the traditional Pascal typed pointer notation "^type", generic scalar types and even C like constructs like int32 and int64.  There 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 has 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 conversions and actions but all good software engineers will doubt the code.

      reply	other threads:[~2015-12-27 11:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <n5kdp5$cji$5@dont-email.me>
     [not found] ` <28691853-48fd-4d68-b28b-3ecbaf7a1bc0@googlegroups.com>
2015-12-26 19:21   ` Here is why C and C++ are bad Anh Vo
2015-12-27 11:25     ` Serge Robyns [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox