Thread: Biggest advantages of C++ over C and vice versa

  1. #16
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,398
    Quote Originally Posted by MartinR View Post
    So here is my question, why C was chose as a base of most OS, programming languages (i.e perl,python) , software and so on.
    Basically why this small language with only 32 keywords and almost 50 years history is still so popular and chosen to so many tasks ?
    At the time Perl and Python (to use your examples) were first being developed, C++ was an unstable, unstandardized language.

    Unfortunately, the impression that C++ is slow, bloated, unstandardized and buggy persists, despite several decades of progress. It's a battle we fight every day in the modern native software world. Between the people who see the obvious forward progress that has been made with C++ and those who choose to cling to obsolete and disproven "facts" while never managing to make a rational argument for their case.

    I really don't have a problem if somebody wants to use C to develop something. I'm simply claiming that I'll get there faster than you, with more accuracy and stability, by using a better tool.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  2. #17
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    Quote Originally Posted by Yarin View Post
    Yes, C++ is so horrible. You want a language that gives you manual memory control and RAII? F**k you!
    B.ro, you sound mad. You mad, bro? You're like a level 12 Venomancer with just Boots of Speed and a Ring of Aquila and I'm a pimped out level 25 Spectre with 600 gold per minute (it's a DotA 2 joke).

    But in all seriousness though, I'm assuming you didn't see the Linux Torvalds link I posted as well. My bad, Linus Torvalds. It was supposed, to be a joke. You should know I love me some C++, lest I make baby Cthulhu cry again.

    But just to play Devil's advocate, C++ is an awful language because it lets bads be bad faster. C++ is terrible in the sense that it's super easy to do it wrong. C++ newbs don't know the STL so they will oftentimes misuse it so they write code that is indeed bloated and slow. This is one fault of C++, if you aren't experienced in it, you're most likely bad at it.

    C doesn't have that by the virtue of not having anything like that. From the start, C is only as powerful as the coder is while C++ gives the coder all the power at once and they may not know how to use it properly which leads to just bad programming all over the place. I'm a perfect programmer so I know these things as fact.

  3. #18
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    This is one fault of C++, if you aren't experienced in it, you're most likely bad at it.
    O_o

    "a bad workman always blames his tools"

    Soma
    “Salem Was Wrong!” -- Pedant Necromancer
    “Four isn't random!” -- Gibbering Mouther

  4. #19
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Quote Originally Posted by MutantJohn View Post
    But in all seriousness though, I'm assuming you didn't see the Linux Torvalds link I posted as well. My bad, Linus Torvalds. It was supposed, to be a joke. You should know I love me some C++, lest I make baby Cthulhu cry again.
    Lol, I did, I know you were joking. I was trying to answer a joke with a joke, based on my observation that while C++ has it's ugly flaws, I find it amazing that in spite of it's age, it still has a particular feature set not present in any other of the numerous "modern" languages being made.


    Quote Originally Posted by MutantJohn View Post
    But just to play Devil's advocate, C++ is an awful language because it lets bads be bad faster. C++ is terrible in the sense that it's super easy to do it wrong. C++ newbs don't know the STL so they will oftentimes misuse it so they write code that is indeed bloated and slow. This is one fault of C++, if you aren't experienced in it, you're most likely bad at it.
    But just to play Devil's advocate, <My Language> is an awful language because it lets bads be bad faster. <My Language> is terrible in the sense that it's super easy to do it wrong. <My Language> newbs don't know <My Language's Stdlib> so they will oftentimes misuse it so they write code that is indeed bloated and slow. This is one fault of <My Language>, if you aren't experienced in it, you're most likely bad at it.

  5. #20
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Quote Originally Posted by Yarin View Post
    if you aren't experienced in it, you're most likely bad at it.
    This is common to all languages, all skills, all things in life.

    Flon's Law:
    There is not now, and never will be, a language in which it is
    the least bit difficult to write bad programs.

    the user CornedBee had this in his sig, but he hasn't posted in a while.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  6. #21
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    How can you guys not see that C and Fortran are obviously excluded from that list? They come with so little, it's impossible to almost do anything in those languages!

  7. #22
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,656
    Quote Originally Posted by MutantJohn View Post
    How can you guys not see that C and Fortran are obviously excluded from that list? They come with so little, it's impossible to almost do anything in those languages!
    Well..in C you generally use the APIs your platform provides.
    In Linux, that would be POSIX and GLib.
    I can't think of anything in STL that isn't present in that combination.
    (Much more, afaik)

  8. #23
    Make Fortran great again
    Join Date
    Sep 2009
    Posts
    1,413
    Quote Originally Posted by manasij7479 View Post
    Well..in C you generally use the APIs your platform provides.
    In Linux, that would be POSIX and GLib.
    I can't think of anything in STL that isn't present in that combination.
    (Much more, afaik)
    I think John's comment was sarcasm.

  9. #24
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    The biggest advantage of C++ over C is the set of language and library features in C++ that are not in C.

    The biggest advantage of C over C++ is the absence of the set of language and library features in C++ that are not in C.

    Simple, huh?
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  10. #25
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Quote Originally Posted by Elkvis View Post
    Quote Originally Posted by yarin
    if you aren't experienced in it, you're most likely bad at it.
    Uh, I didn't say that

  11. #26
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Quote Originally Posted by Yarin View Post
    Uh, I didn't say that
    In post #19 you did.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  12. #27
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Quote Originally Posted by Elkvis View Post
    In post #19 you did.
    Oh. I guess I did say it, but I didn't say it. xD

  13. #28
    Internet Superhero
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    964
    Quote Originally Posted by Elkvis View Post
    This is common to all languages, all skills, all things in life.

    Flon's Law:
    There is not now, and never will be, a language in which it is
    the least bit difficult to write bad programs.

    the user CornedBee had this in his sig, but he hasn't posted in a while.
    Errr, i don't know man. I'd consider Haskell a proof to the contrary
    How I need a drink, alcoholic in nature, after the heavy lectures involving quantum mechanics.

  14. #29
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Quote Originally Posted by Neo1 View Post
    Errr, i don't know man. I'd consider Haskell a proof to the contrary
    that's only because it's hard to write any kind of program in Haskell :P
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  15. #30
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,859
    I use C to program 8 bit microcontrollers and C# when making a program on the computer.

    I've used a C/C++ compiler for the Arduino, but I've never spent more time than that with C++.

    It all comes back to "I'm heading to Earth, what language should I speak?", "Well... That depends on where you land..."
    Fact - Beethoven wrote his first symphony in C

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Resistor value to color code and vice versa
    By Eddie Ramos in forum C++ Programming
    Replies: 15
    Last Post: 09-30-2012, 09:49 AM
  2. Chaning AM to PM and vice versa
    By EssiJoon in forum C Programming
    Replies: 2
    Last Post: 04-19-2012, 09:36 PM
  3. int to char and vice versa
    By mekaj in forum C++ Programming
    Replies: 13
    Last Post: 12-12-2005, 11:35 AM
  4. Problem: far to near copy, and vice versa
    By aaronc in forum C Programming
    Replies: 1
    Last Post: 06-16-2004, 06:37 AM
  5. Binary to ascii and vice versa
    By thenrkst in forum C++ Programming
    Replies: 13
    Last Post: 03-30-2003, 01:17 AM