View Poll Results: Is C better than C++

Voters
28. You may not vote on this poll
  • Yes, C is better

    8 28.57%
  • No, C is not better than C++

    20 71.43%

C better than C++? (POLL)

This is a discussion on C better than C++? (POLL) within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Is C better than C++ Pro's of C: Faster, more compatible with platforms, faster, not owned by Microsoft, was the ...

  1. #1
    Comment your source code! Lynux-Penguin's Avatar
    Join Date
    Apr 2002
    Posts
    533

    C better than C++? (POLL)

    Is C better than C++
    Pro's of C:
    Faster, more compatible with platforms, faster, not owned by Microsoft, was the US national Standard Programming Language, and free compilers (gcc).
    Con: Not owned by Microsoft, not very object oriented, memory efficiency becomes a problem, cross-platform development through compilation is EXTREMELY difficult.
    Asking the right question is sometimes more important than knowing the answer.
    Please read the FAQ
    C Reference Card (A MUST!)
    Pointers and Memory
    The Essentials
    CString lib

  2. #2
    Registered User foniks munkee's Avatar
    Join Date
    Nov 2001
    Posts
    343
    That is kinda like comparing a screwdriver with a spanner - different tools for different jobs.

    And I am confused as to why not being owned by Microsoft is a both a pro and a con - and also why this thread is not in the general area where it is probably more appropriate seeing as though there is very little code being discussed here...

    Oh and so what if it is/was the US national standard - how is that a pro for the billions of people who don't live in the US?

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786

    Re: C better than C++? (POLL)

    Oh Joy....another opportunity for this discussion

    Originally posted by Lynux-Penguin

    Pro's of C:
    Faster,
    Not really......some instances when using virtual functions.....but it depends largely on the compiler. There arent many situations where the speed is that critical......if you are programming games....why would you be really interested in virtual functions?
    Those features that might slow things down are to make the structure of programming easier and they enforce the OOP principals of C++.

    It all translates to the same op code........just depends how the job is done


    more compatible with platforms,
    No...that again would depend on the compiler.....and there arent many platforms that I know of without a C++ compiler


    faster,
    Is there an echo in here?


    not owned by Microsoft,
    Neither is c++!!!

    was the US national Standard Programming Language,
    And?????

    and free compilers (gcc).
    Ugh......http://www.compilers.net/

  4. #4
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,386
    >Is C better than C++

    There's no such as a language being better then the other.

    >Pro's of C: <...> not owned by Microsoft
    >Con: <...> Not owned by Microsoft

    :-)

    Some notes:
    The GCC package also contains a C++ compiler.
    C++ is also standardised.

    It is not an disadvantage of C that it is not very object oriented. If you design your programs non-object oriented, then you don't need an object oriented language.

    C and C++ are both portable if you write standard C and standard C++ code.

    [edit]
    You forgot the option: there's no better.
    [/edit]

  5. #5
    Registered User
    Join Date
    Dec 2001
    Posts
    44
    Okay... let's analyse this question and make sure we know what we're all talking about before we begin. The question, as asked, is:

    "C better than C++?"

    Well, first thing - what do you mean by C and C++? In particular, the only canonical definitions of the language which are widely accepted by 'those in the know' are commonly referred to as ISO C99 and ISO C++ 98. I will assume that this is what was meant - these documents are the most recently published international standards for said languages and are not subject to the mishandling of compiler writers. (In fact, there are very few conforming C++ compilers out there AFAIK, though progress is, and has, been made since ISO C++ 98 was published. The same is true of ISO C99, but it's predecessor ANSI(/ISO?) C89 is widely supported.)

    The hard bit: what do you mean by better?

    Here's my take. The purpose of programming language is to allow programs to be developed more efficiently in terms of time and cost. The real objective is to reduce the time and cost of completing some project or task whether it's a personal project, a group collaboration for the public good or part of a profit making plan. So, 'better' programming languages allow programmers to develop software as part of the project faster and cheaper. The 'best' programming language then is the one which is yields greater productivity.

    Now... here's the next problem. How do you measure how productive programmers are with a given language? That's not a trivial exercise, and the results are not going to be easy to generalise. In fact, I find C 'better' than C++ for many programming projects because I can achieve the project goals in less time and using fewer resources. Sometimes, C++ is 'better' for the task at hand.

    Importantly, the level of proficiency of the programmer in question is very important. If a programmer knows C++ well and has only a passing acquantance with C then obviously C++ is 'better' for them. Likewise, the other way around is equally valid.

    So... do you /really/ mean to ask the question "Is C better than C++?". If so, then surely the only reasonable answer is "depends."

    I find the whole "Language X" vs "Language Y" discussions quite tiresome and very unproductive. Afterall, all you need is one zealot on either side and a lot of people get quite offended!

    Ian Woods

  6. #6
    Registered User
    Join Date
    Apr 2002
    Posts
    9
    ...
    I prefer c over c++, reason:

    1. c isn't object oriented
    2. I like the low levelness of c. /* I know levelness isn't a word! */
    3. c if you ask me has a lot more potential the c++, /* why do you think its the crackers/hackers language. (other then asm) */
    4. I prefer low level programming more then I prefer high level programming!
    5. And if you ask me, its not so damn confusing when, you've programmed thousands of lines into a program!

  7. #7
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,386
    >The purpose of programming language is to allow programs to
    >be developed more efficiently in terms of time and cost.

    That is from a managers point of view. But from a technicians point of view: the purpose of a programming language is to be able to develop software in such a way that it meets system requirements.

    This means that in a lot of situations you don't depend on just one language, but use more languages. A small example: a mobile phone project. The very low level stuff is written in assembly (OS level and below OS level), the low level stuff is written in C and C++ (OS level) and the high level stuff is written in Java (application level / GUI level).

    >How do you measure how productive programmers are with a
    >given language?

    The PSP has shown to be a quite good tool for measuring the productivity of programmers in different languages.

    >In fact, I find C 'better' than C++ for many programming projects
    >because I can achieve the project goals in less time and using
    >fewer resources. Sometimes, C++ is 'better' for the task at
    >hand.

    It also depends on the design and underlying architecture. If these are object oriented, C++ would be 'better'.

    >2. I like the low levelness of c.

    C++ is as low level as C. It just depends on how you write your software.

    >3. c if you ask me has a lot more potential the c++,

    In fact C++ has more potential. It is not only possible to write procedural C code, but also object oriented C++ code. Note that C++ is based on C.

  8. #8
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,825
    > 3. c if you ask me has a lot more potential the c++, /* why do you think its the crackers/hackers language. (other then asm) */

    ::snicker::

    I dunno, since they wouldn't be 1337 if they used VB?

  9. #9
    The Earth is not flat. Clyde's Avatar
    Join Date
    Mar 2002
    Posts
    1,420
    Surely, since you can use every C-command in a C++ program, C++ is better.

  10. #10
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    Originally posted by zer0python
    ...
    I prefer c over c++, reason:

    1. c isn't object oriented
    LOL....and that is an advantage??? Perhaps its your naivety here with OPP more than any negative aspect of the language


    2. I like the low levelness of c. /* I know levelness isn't a word! */
    C++ is no less lowlevel than C....it all translates to machine code.....the difference is in he compilers & the OS and what they will allow you to do


    3. c if you ask me has a lot more potential the c++, /* why do you think its the crackers/hackers language. (other then asm) */
    More potential?? How the hell is that?? You can write procedural code in C++ as well as implement OOP principals.......and C still has more potential??


    4. I prefer low level programming more then I prefer high level programming!
    Fair enough.....


    5. And if you ask me, its not so damn confusing when, you've programmed thousands of lines into a program!
    Again its a matter of experience..........often its easier to understand the structure and purpose of code if you can see an object heirarchy....again this differs from person to person and the code that is being viewed - How well its organised and presented.

  11. #11
    Registered User Aran's Avatar
    Join Date
    Aug 2001
    Posts
    1,301
    This is a ridiculous thread because:

    a.) both languages are C at their core.
    b.) the people who are posting their opinions solidly are people who are not very experienced with C AND C++.
    c.) there have been countless topics with the exact same purose that have gotten fairly no where.

  12. #12
    Unregistered
    Guest
    Nobody can look at 2000 pages of code in any language and be able to understand it. That's why there is a UML.

  13. #13
    Evil Member
    Join Date
    Jan 2002
    Posts
    638
    Clyde, there IS C code that is not C++ code. It is possible to write perfectly legal C that won't compile in C++.

  14. #14
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Originally posted by zer0python
    ...
    I prefer c over c++, reason:

    1. c isn't object oriented
    2. I like the low levelness of c. /* I know levelness isn't a word! */
    3. c if you ask me has a lot more potential the c++, /* why do you think its the crackers/hackers language. (other then asm) */
    4. I prefer low level programming more then I prefer high level programming!
    5. And if you ask me, its not so damn confusing when, you've programmed thousands of lines into a program!
    1) Neither is C++. It can be, but it is not. C++ is not a true OO language.
    2) Um... anything you can do in C, you can do in C++. (Except getting away with not typecasting malloc's return value. )
    3) Oh really? How do you figure?
    4) Use ASM then. See #2.
    5) This is simply a design issue. Although some classes and the like are hard to decypher.

    If you don't like C++ for all of it's additions, you could always simply use it as a "better C" and use classes and the like, while using all of your standard "C" functions.

    Quzah.
    Hope is the first step on the road to disappointment.

  15. #15
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Originally posted by Imperito
    Clyde, there IS C code that is not C++ code. It is possible to write perfectly legal C that won't compile in C++.
    Really?

    #ifdef __cplusplus
    extern "C" {
    #endif

    Actually this statement is inaccurate though. Any "C" code you can write can be made to compile in C++. The reason it "won't compile" is due to the C++ compiler being strict in what it allows.

    Quzah.
    Hope is the first step on the road to disappointment.

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How do you create a Poll?
    By cpjust in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 01-30-2009, 10:35 PM
  2. Poll - Terrorism & Torture
    By Kybo_Ren in forum A Brief History of Cprogramming.com
    Replies: 38
    Last Post: 12-04-2006, 01:08 PM
  3. Hungarian Notation POLL
    By maxhavoc in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 06-21-2004, 10:52 AM
  4. Today on Cprogramming....When Polls go bad?
    By incognito in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 01-25-2002, 12:41 PM
  5. Poll this Poll that
    By ski6ski in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 09-28-2001, 04:19 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21