none
Learn C before C++ RRS feed

  • Question

  • Hi guys, as C is the subset of C++ is it better to learn C before learning C++ ?

    I know most people program in C++ now but all of the functions from C are available to the C++ programmer and when doing embedded systesm programming or the maintenance of existing applications, would it not be a good idea to know C?
    Wednesday, September 3, 2008 8:54 PM

Answers

  • In my personal opinion, no. Many of the bad habits C++ programmers have come from old C habits, or writing C-style code (or even using C APIs) in C++. E.g., direct heap allocation without the use of a smart pointer or instead of using a container class. The only potential advantage I can think of of learning C before C++ is you tend to think at a lower level, and as a result tend to have a better understanding of the cost of your code (in terms of memory and execution overhead). But, you could learn these things by learning C after C++, and you'd have less of a tendency to optimize prematurely when writing C++.
    Wednesday, September 3, 2008 9:19 PM