Thread: C or C++

  1. #46
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    I really don't think we got anywhere.

    Quote Originally Posted by Elysia View Post
    What I meant is that C++ have things such as templates, OOP, classes, etc, etc.
    Yes, you can emulate these in C, but it is not as easy as if they were natively supported. So if you do not have to invent a solution to get it working right, it might be safe to say that it is faster, usually easier and less error-prone to use them than to emulate them.
    Assembly supports even less of such things than C. It does not even feature high-level syntax and statements such as ifs.
    This is what I meant with C++ having more "features".
    I think of it as having more tools available at the tips of the programmer, allowing us to get things done faster. The later part is subjective, of course.
    I don't think anyone disagrees with what this means at face value, but that does not make C++ more functional and flexible than something else, depending on what you need:
    I get that C++ generally deals with a higher-level of abstraction, but that really has nothing to do with flexibility and functionality. You can implement closures in C, you can have an OOP style in C, it all depends on the programmer.
    You know, given that he acknowledges everything you just said, I think you missed his point.

    And to wit, most of the benefit from learning C++ first comes from using stuff like the STL early on, which is actually not the approach people seem to encounter. Even if I'm wrong about that, there is a whole widget for cleaning up STL related errors, so I don't find that to be very newbie-friendly either.... like I said, it's a pain.

    I don't think it's fair to discuss features of X versus Y when we were originally asked a question about learning something. C++ does throw a lot at you, and in a weird way.
    Last edited by whiteflags; 11-06-2009 at 05:52 AM. Reason: added link

  2. #47
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    I can't believe I missed this!!!!!
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  3. #48
    The larch
    Join Date
    May 2006
    Posts
    3,573
    And to wit, most of the benefit from learning C++ first comes from using stuff like the STL early on, which is actually not the approach people seem to encounter. Even if I'm wrong about that, there is a whole widget for cleaning up STL related errors, so I don't find that to be very newbie-friendly either.... like I said, it's a pain.
    On the other hand, one could argue that this is better than nothing.

    (For which reason I wouldn't recommend neither C or C++ as the first language to learn – and if you have some particular applications in mind, you might still consider whether they are a good choice for that.)

    But anyway, STL errors are for wuss's. Try some boost errors (does the tool help with those too?)
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  4. #49
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Haven't we matured past these debates yet?

  5. #50
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by Bubba View Post
    Haven't we matured past these debates yet?
    And I'll add my piece because the exact arguments used so far to convince the OP to go for C++ have done quite a great job at convincing me to go C#.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  6. #51
    Registered User
    Join Date
    Oct 2006
    Posts
    250
    Linux owns windows!

  7. #52
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    And I'll add my piece because the exact arguments used so far to convince the OP to go for C++ have done quite a great job at convincing me to go C#.
    Hehe. Nice.

  8. #53
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Someone should add a rule that C vs C++ debates are not allowed on CBoard...
    "The Internet treats censorship as damage and routes around it." - John Gilmore

  9. #54
    Registered User
    Join Date
    Oct 2009
    Location
    While(1)
    Posts
    377
    By my view C/ C++ both are accurate and fast if they are used with full of there potential.
    But my vote goes to C because of its simplicity and closeness towards hardware.

  10. #55
    Registered User
    Join Date
    Nov 2009
    Posts
    15
    While you people debate on what's silly and what's not, I got a couple of questions...



    1) Is learning C, then C++, the best way to go ?

    2) When you say learning them both is silly, do you mean learning both at the same time ?

    3) When you say learning them both, do you mean learning both at the same time ?

    Thanks!

  11. #56
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by Exutus View Post
    While you people debate on what's silly and what's not, I got a couple of questions...

    1) Is learning C, then C++, the best way to go ?

    2) When you say learning them both is silly, do you mean learning both at the same time ?

    3) When you say learning them both, do you mean learning both at the same time ?

    Thanks!
    I guess everyone will give their own answer, but based on watching this same debate here a bunch of times, my impression is that people are (mostly) presenting the way they learned as the way to learn.

    A couple of things are clear:
    1. if you want to learn C++, you do not need to learn C first. Just start studying C++.
    2. if you want/need to program in both languages, you might as well study both of them. You could do that at the same time, or consecutively, according to your fancy.
    3. since C++ includes most C syntax (altho there are some small differences), once you have this basic syntax down, the difference between the two will be about how you use the syntax to accomplish a goal. Related to this is the use of common libraries, which differ.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  12. #57
    Registered User
    Join Date
    Nov 2009
    Posts
    15
    Then should one then learn Assembly, then C, then C++ then ?

  13. #58
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743
    Just go!
    My Website

    "Circular logic is good because it is."

  14. #59
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by Exutus View Post
    Then should one then learn Assembly, then C, then C++ then ?
    Why? You do not need to know assembly.

    Actually, you do not need to know C or C++. If you would like to learn one of these three, study it. They are not prerequisites for each other. If you would like to learn two, study both of them. If you would like to learn all three -- well, that should keep you busy for a while, anyway.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  15. #60
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    I was just reminded of my all-time favorite Linus Torvalds quote:
    Some people seem to think that C is a real programming language, but they are sadly mistaken. It really is about writing almost-portable assembly language
    I really like that - because it's exactly what I like about C. A good C programmer ought to be able to look at any construct and have a good idea how that command would be represented in Assembly - and yet you can combine those constructs into a higher-level programming style. I think that makes it the perfect OS language. Using it for a user-friendly end-user app, however - is probably not the best choice - but one that I think everyone should at least be able to understand.

Popular pages Recent additions subscribe to a feed