Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #6128

Re: My answer about Ada and FreePascal and C++

From Richard Heathfield <rjh@cpax.org.uk>
Newsgroups comp.programming
Subject Re: My answer about Ada and FreePascal and C++
Date 2015-12-31 18:59 +0000
Organization A noiseless patient Spider
Message-ID <n63tpi$rli$1@dont-email.me> (permalink)
References <n63t38$p9g$1@dont-email.me>

Show all headers | View raw


On 31/12/15 18:50, Ramine wrote:
>
> I wrote:
>
>  > The following is true in C++:
>  >
>  > 1. C/C++ provide implicit type conversions between signed and unsigned
>  > values. Unlike Ada, there is no a runtime check to make sure the value
>  > is convertible to the new type. For example, you can readily “convert” a
>  > negative signed value to an unsigned value.
>
>
> And Richard Heathfield answered:
>
> --
>
> That's perfectly true. For example:
>
> unsigned long maxval = -1;
>
> That's a good thing, not a bad thing.
>
> ---
>
>
> I think  Richard Heathfield that your argument about C++ is stupid,

Well, okay, we can play ad hominem if you like. You think my argument is 
stupid, and I think your articles - your incessant, boring, 
ill-conceived, badly-written articles - are stupid. So what?

> because in FreePascal you have it both ways,  you can have it
> the way of C++ if you don`t compile with the -Cr compiler option

What has that to do with it? In C and C++, unsigned integer arithmetic 
is performed modulo 2^(CHAR_BIT * sizeof(unsigned_type)). That's not a 
weakness. That's a feature, and a very useful feature. If you don't like 
it, don't use C or C++. But to say that they are not suitable for 
such-and-such a purpose just because they contain a feature you don't 
like is utterly preposterous.

> and you can have it the Ada way if you compile it with the FreePascal
> compiler -Cr option, the FreePascal -Cr compiler option is suitable
> for realtime safety critical systems where you have to constrain
> the system with an unsigned int and you want at runtime to catch
> the exception locally in the function or you want to catch the
> exception globally, that`s what you can do in FreePascal and Ada, but
> you can not do it in C and C++ , so C++ and C are not suitable
> for realtime safety critical systems.

Using the same logic, Pascal incorrectly uses the semicolon as a 
separator rather than as a terminator, and therefore Pascal is not 
suitable for realtime safety critical systems. *That* is a stupid 
argument, and it's identical in form to your own.

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

Back to comp.programming | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: My answer about Ada and FreePascal and C++ Richard Heathfield <rjh@cpax.org.uk> - 2015-12-31 18:59 +0000
  Re: My answer about Ada and FreePascal and C++ JJ <jj4public@vfemail.net> - 2016-01-01 07:23 +0700
    Re: My answer about Ada and FreePascal and C++ Kaz Kylheku <kaz@kylheku.com> - 2016-01-01 01:07 +0000
      Re: My answer about Ada and FreePascal and C++ JJ <jj4public@vfemail.net> - 2016-01-01 18:16 +0700
        Re: My answer about Ada and FreePascal and C++ Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-01 14:34 +0000
          Re: My answer about Ada and FreePascal and C++ JJ <jj4public@vfemail.net> - 2016-01-02 09:58 +0700
            Re: My answer about Ada and FreePascal and C++ Kaz Kylheku <kaz@kylheku.com> - 2016-01-02 03:23 +0000
              Re: My answer about Ada and FreePascal and C++ JJ <jj4public@vfemail.net> - 2016-01-02 21:35 +0700
        Re: My answer about Ada and FreePascal and C++ Kaz Kylheku <kaz@kylheku.com> - 2016-01-01 16:08 +0000

csiph-web