Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Why do people still use C instead of C++ ?

Reply
Thread Tools

Why do people still use C instead of C++ ?

 
 
Daniel Pitts
Guest
Posts: n/a
 
      01-09-2009
Bo Persson wrote:
> Ian Collins wrote:
>> pgadmin wrote:
>>> At the kernel level, there is a difference between C and C++.
>>>
>>> And that difference is performance. At the kernel level,
>>> each indirection is a memory reference, which is much slower
>>> than register access.
>>>
>>> The penalty in performance is probably around 50%, AT LEAST,
>>> compared to pure C.
>>>

>> Care to prove that?

>
> Sure.
>
> In C++ everything is a class using multiple inheritance and dynamic
> allocation. All funtions are virtual, always.
>
> In C everything is an int, allocated to a register. Much more
> efficient!
>
>
> Bo Persson
>
>

That is hardly a proof of anything. Especially since there are no
references or explanation of how you came to that conclusion.

Unless... Are you're being facetious and I missed it?

--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
 
Reply With Quote
 
 
 
 
Bo Persson
Guest
Posts: n/a
 
      01-10-2009
Daniel Pitts wrote:
> Bo Persson wrote:
>> Ian Collins wrote:
>>> pgadmin wrote:
>>>> At the kernel level, there is a difference between C and C++.
>>>>
>>>> And that difference is performance. At the kernel level,
>>>> each indirection is a memory reference, which is much slower
>>>> than register access.
>>>>
>>>> The penalty in performance is probably around 50%, AT LEAST,
>>>> compared to pure C.
>>>>
>>> Care to prove that?

>>
>> Sure.
>>
>> In C++ everything is a class using multiple inheritance and dynamic
>> allocation. All funtions are virtual, always.
>>
>> In C everything is an int, allocated to a register. Much more
>> efficient!
>>
>>
>> Bo Persson
>>
>>

> That is hardly a proof of anything. Especially since there are no
> references or explanation of how you came to that conclusion.
>
> Unless... Are you're being facetious and I missed it?


Probably.

That was my impression of why some people don't like C++, including
Linus Torvalds.

The argument seems to be that it is easier to write bad code in C++
than in C. Some of us argue that it is also easier to write good code
in C++.


Bo Persson


 
Reply With Quote
 
 
 
 
sorin12345 sorin12345 is offline
Junior Member
Join Date: May 2011
Posts: 1
 
      05-21-2011
You know, I got to this page after searching the web for the EXACT OPPOSITE: “why use c++ instead of c?”
My question was “what are the advantages of c++ that cannot be just more easily written in c?”
So I was surprised that most articles were actually discussing about “why would someone use c instead of c++ ?”

So before any more harm is done, and before any more casualties among the ranks of newbie/freshmeat programmers, and among the armies of programmers in general, I suggest you to have a good look at this article:
http://yosefk.com/c++fqa/defective.html

Hopefully this will convince new software “recruits” to stay away from C++, and either stick to C, or better yet to learn some useful high-level programming language like java, ruby, scala, or even javascript (which is a really great dynamic language, and can be viewed as superset of LISP – “LISP with named slots”)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Do people still use a shutter release cable in digital camera age? aniramca@gmail.com Digital Photography 30 07-24-2007 04:55 AM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
why are people still using classic classes? Simon Wittber Python 16 01-14-2005 09:53 PM
Why do people still insist that the holocaust didn't occur? Fred A. Miller Digital Photography 11 02-26-2004 12:49 AM
STL: Do people still use char[] buffers? syncman C++ 4 01-20-2004 09:09 PM



Advertisments