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


Groups > comp.lang.c > #111860 > unrolled thread

Re: should c be a subset of c++?

Started bybrook.monroe@gmail.com
First post2017-06-08 13:19 -0700
Last post2017-06-09 21:57 +0200
Articles 14 — 9 participants

Back to article view | Back to comp.lang.c

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: should c be a subset of c++? brook.monroe@gmail.com - 2017-06-08 13:19 -0700
    Re: should c be a subset of c++? supercat@casperkitty.com - 2017-06-08 14:06 -0700
    Re: should c be a subset of c++? Melzzzzz <Melzzzzz@zzzzz.com> - 2017-06-08 21:40 +0000
    Re: should c be a subset of c++? jacobnavia <jacob@jacob.remcomp.fr> - 2017-06-09 00:04 +0200
      Re: should c be a subset of c++? Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2017-06-08 18:12 -0400
        Re: should c be a subset of c++? jacobnavia <jacob@jacob.remcomp.fr> - 2017-06-09 00:38 +0200
          Re: should c be a subset of c++? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-06-09 01:19 +0100
      Re: should c be a subset of c++? Ian Collins <ian-news@hotmail.com> - 2017-06-09 12:06 +1200
      Re: should c be a subset of c++? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-06-09 01:15 +0100
    Re: should c be a subset of c++? GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-09 02:06 +0200
      Re: should c be a subset of c++? "Pascal J. Bourguignon" <pjb@informatimago.com> - 2017-06-09 02:55 +0200
        Re: should c be a subset of c++? GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-09 09:58 +0200
      Re: should c be a subset of c++? supercat@casperkitty.com - 2017-06-09 09:29 -0700
        Re: should c be a subset of c++? GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-09 21:57 +0200

#111860 — Re: should c be a subset of c++?

Frombrook.monroe@gmail.com
Date2017-06-08 13:19 -0700
SubjectRe: should c be a subset of c++?
Message-ID<d5439a2a-1230-4e26-9251-3f3b6527684b@googlegroups.com>
On Tuesday, August 25, 2015 at 5:14:34 PM UTC-4, G G wrote:
> Bjarne Stroustrup: Why the Programming Language C Is Obsolete 
> https://www.youtube.com/watch?v=KlPC3O1DVcg
> 
> 
> this is dated : 2011
> 
> i don't think so. but ...

Bjarne arrogant?  He's never seemed that way to me.  Linus Torvalds, on the other hand....  Has Bjarne, to the best of anyone's knowledge. ever accused individuals who didn't understand C++ of being "morons" the way Linus did for people who don't understand Git?

Exactly.

C was good for what it was good for.  There's a lot of it still out there, which attests to its longevity.  (For example, Linux.  What is it with Linus, anyway?)  You can still write C in most C++ compilers (except for the wonky original K&R function argument syntax).

There are a lot of things for which C is pretty bad, though.  Deterministic release of resources and memory, for example.  RAII--a seriously useful concept--just doesn't work in C.  C++ alias, compile-time const, and constexpr are better than #define macros any day of the week.

From a purely practical standpoint, I'm far more capable and effective in C++ than I ever was in C.  I agree that C++ still has issues when it comes to embedded programming, but outside of that, and in practical terms, C just doesn't do a good job of keeping up in the 21st century.  That doesn't make it bad--it just makes it not the first tool of choice in most low-level programming tasks outside of embedded.

Here's the thing that I meant to say: ad hominem arguments just show you don't actually have any argument to make.  Discussions of whether C++ is better than C (or chocolate, or claw hammers) shouldn't revolve around whether or not Bjarne has personality defects.  (Perhaps he does.  I haven't detected them.  I wish I could say that about Linus Torvalds.  Actually, I don't wish that, but it makes me seem nicer if I write that.)

[toc] | [next] | [standalone]


#111861

Fromsupercat@casperkitty.com
Date2017-06-08 14:06 -0700
Message-ID<ad9a8815-c409-46ad-81a8-8ecd05f9db71@googlegroups.com>
In reply to#111860
On Thursday, June 8, 2017 at 3:19:17 PM UTC-5, brook wrote:
> From a purely practical standpoint, I'm far more capable and effective in C++ than I ever was in C.  I agree that C++ still has issues when it comes to embedded programming, but outside of that, and in practical terms, C just doesn't do a good job of keeping up in the 21st century.  That doesn't make it bad--it just makes it not the first tool of choice in most low-level programming tasks outside of embedded.

I would think that the primary continuing usefulness of C would lie in
the embedded realm, where it has no real competition, but the kinds of
aggressive optimizations that some compiler vendors are pushing offer
far less benefit on the low-end processors that are typical of the
embedded world, than on high-end PCs.  I can accept that there may be
some application fields where such optimizations are genuinely useful,
but they're very far removed from most kinds of embedded programming.

[toc] | [prev] | [next] | [standalone]


#111863

FromMelzzzzz <Melzzzzz@zzzzz.com>
Date2017-06-08 21:40 +0000
Message-ID<ohcg7i$1hj$1@news.albasani.net>
In reply to#111860
On 2017-06-08, brook.monroe@gmail.com <brook.monroe@gmail.com> wrote:
>
> There are a lot of things for which C is pretty bad, though.
> Deterministic release of resources and memory, for example.

Hm? This is nonsense.


-- 
press any key to continue or any other to quit...

[toc] | [prev] | [next] | [standalone]


#111864

Fromjacobnavia <jacob@jacob.remcomp.fr>
Date2017-06-09 00:04 +0200
Message-ID<ohchet$vl9$1@dont-email.me>
In reply to#111860
Le 08/06/2017 à 22:19, brook.monroe@gmail.com a écrit :
 From a purely practical standpoint, I'm far more capable and effective 
in C than I ever would be in C++.

THE REASON IS THAT C IS A SIMPLE LANGUAGE, EASY TO USE.

Woops, I had the caps lock on. But now that I read it like that, it 
looks ok. Why not say it clearly.

I agree that C still has issues when it comes to programming, but 
outside of that,

and in practical terms, C++ just doesn't do a good job of keeping up in 
the 21st century.

The complexity of C++ is so staggering, and so way beyond what is 
necessary to learn a language that it is not adapted to the human brain.

Humans aren't machines, and there is a limited space in brain memory to 
memorize computer trivia. Humans aren't compilers and they can follow a
limited number of indirections, class hierarchies, embedded templates, 
lambda expressions and what have you.


That doesn't make C++ bad--it just makes it not the first tool of choice 
in programming tasks outside of legacy systems.

Of course concepts like operator overloading, generic functions, and 
many others could have been introduced into C, without complexifying 
anything.

I wrote a clone of the STL in C. Templates are replaced by macros and it 
works, in a very primitive way. Of course you could write (in C) an 
automata that could allow you template expansion as you want.

But I did not do it.

Two versions are provided: the generic container version (using void *), 
and a macro version, where the preprocessor generates inline code for an 
specific type/structure.

This proposal was considered an heresy by the C committee, and they 
refused to work in that direction. This is a long standing politic of 
C++ people of denigrating C, and forbidding any C development. Most of 
the members of the committee are also in the C++ committees, and one of 
them, said that he compiles always his C code with the C++ compiler.

New development should be done in C++. Still, some committee members 
voted for the proposal.

Why this destruction of C?

Because it is a simple language, easy to use?

You can learn C in some weeks, if you know something about programming 
before, say Basic, or java script.

You can get really into it after some time using it, as anything.

Simple languages are easier to grasp, easier on the brain. And that 
counts for humans.

C reminds of of this question:

Is all that complexity really necessary?

jacob



[toc] | [prev] | [next] | [standalone]


#111866

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2017-06-08 18:12 -0400
Message-ID<ohchue$rhn$1@dont-email.me>
In reply to#111864
jacobnavia wrote:

> Le 08/06/2017 à 22:19, brook.monroe@gmail.com a écrit :
>  From a purely practical standpoint, I'm far more capable and effective
> in C than I ever would be in C++.
> 
> THE REASON IS THAT C IS A SIMPLE LANGUAGE, EASY TO USE.
> 
> Woops, I had the caps lock on. But now that I read it like that, it
> looks ok. Why not say it clearly.
> 
> I agree that C still has issues when it comes to programming, but
> outside of that,
> 
> and in practical terms, C++ just doesn't do a good job of keeping up in
> the 21st century.
> 
> The complexity of C++ is so staggering, and so way beyond what is
> necessary to learn a language that it is not adapted to the human brain.

This reminds me of the answer Brian Kernighan gave an interviewer[1] 
regarding programming in C++:

  Sometimes I do write C++ instead of C. C++ I think is basically too big a
  language, although there's a reason for almost everything that's in it.
  When I write a C program of any size, I probably will wind-up using 75,
  80, 90% of the language features. In other words, most of the language is
  useful in almost any kind of program. By contrast, if I write in C++ I
  probably don't use even 10% of the language, and in fact the other 90% I
  don't think I understand. In that sense I would argue that C++ is too big
  ...

[1] https://www.cs.cmu.edu/~mihaib/kernighan-interview/

[snip]


-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

[toc] | [prev] | [next] | [standalone]


#111867

Fromjacobnavia <jacob@jacob.remcomp.fr>
Date2017-06-09 00:38 +0200
Message-ID<ohcjf4$5vh$1@dont-email.me>
In reply to#111866
Le 09/06/2017 à 00:12, Lew Pitcher a écrit :
> if I write in C++ I
>    probably don't use even 10% of the language, and in fact the other 90% I
>    don't think I understand. In that sense I would argue that C++ is too big

He said that in July 2000. Before all the "enhancements" that came later!

Now, the percentage would be 1% to 99%?

And they do not seem to be able to stop...

More and more features are added, new syntax and semantics in even more 
new paradigms taken from Common Lisp, for instance.

The problem now is that there is no longer any human brain that 
understands the whole language.

The brain of Bjarne, that started all that, is unable to add a new 
feature after some years of effort. Nobody really understands all the 
aspects of C++ any more, and in complex systems there is NO OTHER method 
that starting up the debugger, and figuring out what is being called and 
how the control flows in a given execution path.

The only method in C to do this kind of unreadable code is to use tables 
of function pointers, for instance, dynamically assigned. But in 
general, you CAN read some C code and see what it is doing.

What we must understand is that there is no free lunch. Increased 
complexity of the language is expensive in work that is needed to 
understand a piece of code when the original  writer is absent or worst, 
he has forgotten what his code was doing.



[toc] | [prev] | [next] | [standalone]


#111872

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2017-06-09 01:19 +0100
Message-ID<87ink6c8s4.fsf@bsb.me.uk>
In reply to#111867
jacobnavia <jacob@jacob.remcomp.fr> writes:

> Le 09/06/2017 à 00:12, Lew Pitcher a écrit :
>> if I write in C++ I
>>    probably don't use even 10% of the language, and in fact the other 90% I
>>    don't think I understand. In that sense I would argue that C++ is too big

And this quoting is just plain wrong.  These words are not Lew's.
Please take a little more care with attribution lines and quotes.

<snip>
-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#111869

FromIan Collins <ian-news@hotmail.com>
Date2017-06-09 12:06 +1200
Message-ID<epu74iFb6bvU2@mid.individual.net>
In reply to#111864
On 06/ 9/17 10:04 AM, jacobnavia wrote:
>
> This proposal was considered an heresy by the C committee, and they
> refused to work in that direction. This is a long standing politic of
> C++ people of denigrating C, and forbidding any C development.

Name one.

-- 
Ian

[toc] | [prev] | [next] | [standalone]


#111871

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2017-06-09 01:15 +0100
Message-ID<87o9tyc8yo.fsf@bsb.me.uk>
In reply to#111864
jacobnavia <jacob@jacob.remcomp.fr> writes:

> Le 08/06/2017 à 22:19, brook.monroe@gmail.com a écrit : From a purely
> practical standpoint, I'm far more capable and effective in C than I
> ever would be in C++.

I know it's not marked with ">"s but this could be taken to be a quote,
especially as you are using the same shape of sentence for rhetorical
effect.  If you are not quoting any text from a poster, it's clearer if
you remove the attribution line.

<snip>
-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#111870

FromGOTHIER Nathan <nathan.gothier@gmail.com>
Date2017-06-09 02:06 +0200
Message-ID<20170609020648.c723063a79271e3cd57e365f@gmail.com>
In reply to#111860
On Thu, 8 Jun 2017 13:19:11 -0700 (PDT)
brook.monroe@gmail.com wrote:

> Bjarne arrogant?  He's never seemed that way to me.  Linus Torvalds, on the
> other hand....  Has Bjarne, to the best of anyone's knowledge. ever accused
> individuals who didn't understand C++ of being "morons" the way Linus did for
>people who don't understand Git?

He's not arrogant but a C loser. That's why he ripped off C to rehabilitate his
self esteem. Despite playing the partition of a victim offensed by dumb
programmers, C++ is a pile of gadgets with no fundamental reasons to be required
in a programming language.

ITOH Linus TORVALDS can have hard words against his peers but most of the time
it is fairly justified. He's in charge of a kernel code base, that's not a
lambda code for a rotten app sold at low price on a click store for kids.


> C was good for what it was good for.  There's a lot of it still out there,
> which attests to its longevity.  (For example, Linux.  What is it with Linus,
> anyway?)  You can still write C in most C++ compilers (except for the wonky
> original K&R function argument syntax).

I can assure you that C is still relevant nowadays and even more against the
current more bloated than ever C++.

Actually you lost all your credibility pretending C programs are obsolete and
can be built with C++ compilers as if C++ was an upper layer of C.

Consequently, if C is no more relevant, according to the concept of
inheritance, a fundamental part of C++ should be removed.


> There are a lot of things for which C is pretty bad, though.  Deterministic
> release of resources and memory, for example.  RAII--a seriously useful
> concept--just doesn't work in C.  C++ alias, compile-time const, and constexpr
> are better than #define macros any day of the week.

Memory management is the key point that enables to distinguish skilled C coders
from C++ monkeys expecting the compiler to be clever than the programmer.


> From a purely practical standpoint, I'm far more capable and effective in C++
> than I ever was in C.  I agree that C++ still has issues when it comes to
> embedded programming, but outside of that, and in practical terms, C just
> doesn't do a good job of keeping up in the 21st century.  That doesn't make it
> bad--it just makes it not the first tool of choice in most low-level
> programming tasks outside of embedded.

You should also agree with the fact that you are so bad at C that only C++ can
compile your crippled code.


> Here's the thing that I meant to say: ad hominem arguments just show you don't
> actually have any argument to make.  Discussions of whether C++ is better than
> C (or chocolate, or claw hammers) shouldn't revolve around whether or not
> Bjarne has personality defects.  (Perhaps he does.  I haven't detected them.  I
> wish I could say that about Linus Torvalds.  Actually, I don't wish that, but
> it makes me seem nicer if I write that.) 

That's always the same song... with the same partition.

[toc] | [prev] | [next] | [standalone]


#111873

From"Pascal J. Bourguignon" <pjb@informatimago.com>
Date2017-06-09 02:55 +0200
Message-ID<m2poee7zef.fsf@despina.home>
In reply to#111870
GOTHIER Nathan <nathan.gothier@gmail.com> writes:

> Actually you lost all your credibility pretending C programs are obsolete and
> can be built with C++ compilers as if C++ was an upper layer of C.


    #include <stdio.h>
    int main(){
        int C=88;
        printf("C++ = %d\n",C++);
        printf("C   = %d\n",C);
        return 0;
    }

prints:

    C++ = 88
    C   = 89

which shows that C is clearly superior to C++…


-- 
__Pascal J. Bourguignon
http://www.informatimago.com

[toc] | [prev] | [next] | [standalone]


#111875

FromGOTHIER Nathan <nathan.gothier@gmail.com>
Date2017-06-09 09:58 +0200
Message-ID<20170609095842.c5d09bb1181b3844c9daecde@gmail.com>
In reply to#111873
On Fri, 09 Jun 2017 02:55:36 +0200
"Pascal J. Bourguignon" <pjb@informatimago.com> wrote:

> which shows that C is clearly superior to C++…

You missed the fact that C++ is currently set to 2014 while C is valued to
2011 which shows that C++ is following a buggy logic. :o)

[toc] | [prev] | [next] | [standalone]


#111891

Fromsupercat@casperkitty.com
Date2017-06-09 09:29 -0700
Message-ID<30694c8f-7748-401a-b603-2dd2faacac57@googlegroups.com>
In reply to#111870
On Thursday, June 8, 2017 at 7:10:10 PM UTC-5, GOTHIER Nathan wrote:
> Memory management is the key point that enables to distinguish skilled C coders
> from C++ monkeys expecting the compiler to be clever than the programmer.

Efficient memory management often requires the ability to use storage as
different types without having to completely write it.  Since C can be used
for many kinds of applications that don't need to recycle memory as different
types, the Standard doesn't require that all implementations must support
such recycling.  I find ironic the eagerness with which some C compiler
vendors want to abandon what would otherwise make C unique.

[toc] | [prev] | [next] | [standalone]


#111905

FromGOTHIER Nathan <nathan.gothier@gmail.com>
Date2017-06-09 21:57 +0200
Message-ID<20170609215719.89405db3244754b74d9f692a@gmail.com>
In reply to#111891
On Fri, 9 Jun 2017 09:29:22 -0700 (PDT)
supercat@casperkitty.com wrote:

> Efficient memory management often requires the ability to use storage as
> different types without having to completely write it.  Since C can be used
> for many kinds of applications that don't need to recycle memory as different
> types, the Standard doesn't require that all implementations must support
> such recycling.  I find ironic the eagerness with which some C compiler
> vendors want to abandon what would otherwise make C unique.

It is the global trend of digital losers wanting to rule de world... of
computers/tablets/smartphones/anytoys.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c


csiph-web