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


Groups > comp.arch > #32162

Re: Here is what i think of C and C++

Newsgroups comp.arch
Date 2015-12-26 16:31 -0800
References <n5mnne$kjv$6@dont-email.me> <fec45b86-9461-4bce-b8a3-0df45d49191f@googlegroups.com> <79817343-ae08-4942-9011-2ce26719c2a4@googlegroups.com>
Message-ID <cbb465de-e259-4b2f-843d-8b01a630a615@googlegroups.com> (permalink)
Subject Re: Here is what i think of C and C++
From jim.brakefield@ieee.org

Show all headers | View raw


On Saturday, December 26, 2015 at 2:17:05 PM UTC-6, Quadibloc wrote:
> On Saturday, December 26, 2015 at 12:07:12 PM UTC-7, Rick C. Hodgin wrote:
> > Their strict type-checking
> > rules require CPU time to implement.
> 
> Huh? Bounds checking certainly requires CPU time, but isn't type checking all 
> done at compile time?
> 
> The freedom provided by C, of course, is needed for some purposes, so having it 
> doesn't make C a "bad" language - something for general purposes that would be 
> less strict than some languages, but a better fit than C, would be nice. 
> However, the popularity of a language is also very important, making it 
> unlikely progress will be made any time soon.
> 
> John Savard

John Savard: 

Bounds checking certainly requires CPU time, but isn't type checking all 
done at compile time?

IMHO:
Across the spectrum of programming languages, various calculations including type inference and bounds checking occur in various places.  A "smart" compiler will move as much calculation as far forward as possible (e.g. outside loops, to compilation time, etc.), the degree to which this can be done varies with each language.  (treating the program as an expression graph; graph reduction, e.g. calculation, can be done in bits and pieces whenever the operands become known).

From this very general perspective, the human activity of programming becomes one of choosing the most appropriate abstraction of the computation and hopefully letting the compiler do as much of the details as possible.  I like type checking (and for that matter any kind of error checking) and wish that bounds checking can be moved out of loops.

Which brings up the issue of address checking.  C lets one do address manipulations with abandon.  So one should also have the compiler do address checking.  ADA and other such languages try to restrict use of addresses for this very purpose.  One could propose a version of C that somehow implements an option for address checking?

Jim Brakefield

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


Thread

Here is what i think of C and C++ Ramine <ramine@1.1> - 2015-12-26 13:56 -0800
  Here is what i think of C and C++ "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-12-26 11:07 -0800
    Re: Here is what i think of C and C++ Quadibloc <jsavard@ecn.ab.ca> - 2015-12-26 12:17 -0800
      Re: Here is what i think of C and C++ jim.brakefield@ieee.org - 2015-12-26 16:31 -0800
        Re: Here is what i think of C and C++ "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-12-27 11:39 -0800
      Re: Here is what i think of C and C++ George Neuner <gneuner2@comcast.net> - 2015-12-28 14:16 -0500
    Re: Here is what i think of C and C++ Walter Banks <walter@bytecraft.com> - 2015-12-26 16:36 -0500
      Re: Here is what i think of C and C++ "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-12-26 14:14 -0800
        Re: Here is what i think of C and C++ Walter Banks <walter@bytecraft.com> - 2015-12-27 10:46 -0500
          Re: Here is what i think of C and C++ BGB <cr88192@hotmail.com> - 2015-12-27 09:50 -0600
          Re: Here is what i think of C and C++ "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-12-27 09:57 -0800
          Re: Here is what i think of C and C++ anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-27 17:43 +0000
            Re: Here is what i think of C and C++ Walter Banks <walter@bytecraft.com> - 2015-12-28 00:18 -0500
            Re: Here is what i think of C and C++ Walter Banks <walter@bytecraft.com> - 2015-12-28 00:30 -0500
    Re: Here is what i think of C and C++ Anonymous <no_email@invalid.invalid> - 2015-12-27 04:27 +0000
      Re: Here is what i think of C and C++ "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-12-27 09:44 -0800
      Re: Here is what i think of C and C++ EricP <ThatWouldBeTelling@thevillage.com> - 2015-12-27 16:35 -0500
    Re: Here is what i think of C and C++ Megol <golem960@gmail.com> - 2015-12-27 07:23 -0800

csiph-web