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


Groups > comp.programming > #6060

Re: Here is why C++ and C are bad...

From Kaz Kylheku <kaz@kylheku.com>
Newsgroups comp.programming
Subject Re: Here is why C++ and C are bad...
Date 2015-12-26 17:19 +0000
Organization Aioe.org NNTP Server
Message-ID <20151226091049.876@kylheku.com> (permalink)
References <n5kdn4$cji$1@dont-email.me> <dd63b083-ed7d-4abf-ab6e-ed2a32c90228@googlegroups.com>

Show all headers | View raw


On 2015-12-26, Öö Tiib <ootiib@hot.ee> wrote:
> On Friday, 25 December 2015 23:53:07 UTC+2, Ramine  wrote:
>>
>> In this example, C++ and C will convert i from a signed int type to 
>> unsigned int type but this is not good , because this types of 
>> conversion can cause bugs and errors of logic , so i think we must 
>> forbid C and C++ on realtime critical systems... and i have read on 
>> internet that C and C++ are strongly typed languages, how can you
>> say that ! ingnoring the simple fact that an implicit conversion
>> in C++ and C takes place between a signed int type and an unsigned int 
>> type for example, so that makes C and C++ problematic and not suited for 
>> realtime critical systems and such, ADA and Delphi and FreePascal are in 
>> fact strongly typed and does not authorize this type of conversion.
>> 
>
> Software that is written by people who have difficulties with logic and 
> so use trial and error to write their code may work. 
> It is exceedingly difficult to use C or C++ with that method because
> those languages are permissive. The languages assume that programmer
> does exactly know what he is doing.

Not allowing an implicit conversion between integer and floating is
"stupidly typed". Forcing explicit conversions for this into programs
adds so much clutter that it's not worth it.

Many languages have this conversion freedom, including ones that do not
have C's reputation for making it difficult to develop reliable
programs.

Python:

        >>> 1.0 + 2
        3.0
        >>>

Common Lisp (using CLISP implementation):

        [1]> (+ 1.0 2)
        3.0

Ruby:

        > 1.0 + 2
        => 3.0

One source of bugs is verbose clutter, where they can hide.

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


Thread

Re: Here is why C++ and C are bad... Öö Tiib <ootiib@hot.ee> - 2015-12-26 05:57 -0800
  Re: Here is why C++ and C are bad... Kaz Kylheku <kaz@kylheku.com> - 2015-12-26 17:19 +0000

csiph-web