Thread: Rationale for C first: please critique

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    If you intend to learn C++, then learn C++. There is no need to learn C beforehand. Similarly, if you intend to learn C, there is no need to learn C++ beforehand. There a possible exception if you need to write C++ libraries code interfaces to lower level code (eg device drivers, wrapping C libraries, etc), in which case you need to know both .... see next para.

    If you anticipate a need to know both languages (eg a job that involves maintaining old C and C++ code) then you will need to know the differences between them, and techniques in both languages. In this case, the choice of what to learn first depends on your learning style. If you have a theoretical or conceptual learning style (ie you prefer to learn concepts and techniques before putting into practice), you will be better off learning C++ first (and you will groan when it comes to learning C, as it will seem so dirty and low-down). If you have a hands learning style (ie you prefer to learn by doing things hands-on as a means of learning ideas) then you will be better off learning C first (and you will groan when you move to C++, as you will keep being tempted to do things hands-on, and using C++ well means sitting back and doing things conceptually first). Either way, if you need to learn both languages and understand where the differences between them are (often essential when maintaining code) the hardest thing will be the transition between them.

    Practical gotchas result from the fact that a lot of older C compilers (as per 1989 standard) are actually C++ compilers, meaning that the C you learn often includes some elements of C++. The (deliberate) backward compatibility of C++ to C also encourages a lot of people to write C code that uses a few C++ features and insist they are doing C++ (they are, but it's not a good way to use C++). A lot of basic guides for both languages also blur the distinctions between the two languages: precisely because the authors don't fully understand the differences either.
    Last edited by grumpy; 08-10-2008 at 04:17 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linked List question from a newb(Need code Critique)
    By Gatt9 in forum C++ Programming
    Replies: 2
    Last Post: 01-08-2006, 03:11 AM
  2. Critique my StringTokenizer please...
    By maxhavoc in forum C++ Programming
    Replies: 10
    Last Post: 11-24-2004, 09:08 PM
  3. Critique my program
    By Jason Spaceman in forum C Programming
    Replies: 6
    Last Post: 10-26-2004, 05:38 PM
  4. Resource ICONs
    By gbaker in forum Windows Programming
    Replies: 4
    Last Post: 12-15-2003, 07:18 AM
  5. critique me please
    By ober in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 10-02-2002, 01:59 PM