Offers,advice,whether,must,know,before,prefer
Quick Search for:  in language:    
Offers,advice,whether,must,know,before,prefer
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
C/ C++ Stats

 Code: 451,578 lines
 Jobs: 605 postings

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for C/ C++.
Visual Pi Hex
By jo122321323 on 8/25


Click here to see a screenshot of this code!ShortCutSample
By Massimiliano Tomassetti on 8/25

(Screen Shot)

AnPMoneyManager beta
By Anthony Tristan on 8/24


A calculator (english/polish )
By Tom Dziedzic on 8/24


MMC (Mouse Move Counter)
By Laszlo Hegedüs on 8/24


Text-DB
By Jerome A. Simon on 8/24


JDos
By Jerome A. Simon on 8/23


Game 1945X
By Ozgun Harmanci on 8/23


Find hidden "back streamed" files on NTFS partitions. This code is a must for sec consultants.
By Israel B. Bentch on 8/22


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Should I learn C before C++? Isn't C better because it has less overhead?

Print
Email
 

Submitted on: 6/27/2000 10:36:06 AM
By: Blake Madden 
Level: Beginner
User Rating: By 12 Users
Compatibility:C++ (general)

Users have accessed this article 6778 times.
 
(About the author)
 
     Offers advice on whether you must know C before C++ and whether C is preferable over C++ because of overhead.

 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
1) You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
Should I learn C before C++? Isn't C better because it has less overhead? These are very valid questions and ones that I believe should be answered prior to delving into the world of C/C++. I feel that the answers are "no, you should learn C++ first, then you should come to understand the fundamental differences C++ and its predocessor" and "no, C++ still retains the efficiency of C with improved and new features." Many people are apt to veiw C and C++ as two entirely different languages, whereas I prefer to see C++ as an improved version of C that can still utilize many of the features that are thought of as "C-style." Some C programmers will argue that C++ is too large with too much overhead. The fact is that there is indeed more overhead with classes as opposed to (C-style, data-only) structures. However, you should bear in mind that just because you are using C++ you don't need to make everything object-oriented. This is to say, if you feel the situation calls for a simple structure or enumeration, then by all means use them. There's nothing wrong with utilizing the less complex and more efficient C-style data types when data encapsulation isn't a major concern, but memory is. The point is, C++ is a better C with improved (completely overhauled , actually) data structures, memory allocation, and I/O features. You are much better off learning and using this improved methods first, and then go back and familiarize yourself with the way C handles these methods. C++ is a big, complex language, but I honestly don't feel that coming to learn C first will necessarily aid you. Learning C's (error-prone) I/O system and memory allocation instead of C++'s will only cause bad practice and style further down the road. However, you should at least understand C's methods in case you ever work with legacy code. You also can familiarize yourself with the data structure efficieny in C, so that you can incorproate that along with object-oriented data structures. I have to agree with some C++ critics that it can have a bit of overhead in some cases, but C++'s advanced features--like overloaded operators and multiple inheritance--are options, not requirements. This is the whole reason why C was chosen to be the base language, because of its efficiency, and C++ still has all of that efficieny with improved and more features.


Other 2 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this article(in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
6/28/2000 4:32:42 AM:Dustin Davis
Dude, dont post things like this on PSC. But if you must know, i learned C before C++ and C was easy to learn, C++ was hard, but knowing C made it alot easier. I suggest doing as I did, learn C basics, then learn C++.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/28/2000 11:25:56 AM:Blake Madden
What's easier? C: CObject* pObject = (CObject*)malloc(sizeof(CObject)); or C++: CObject* pObject = new CObject; C: printf("Integer %i Float %f Pointer %p", IntVar, FloatVar, PointerVar); or C++: cout << IntVar << " " << FloatVar << " " << PointerVar; Yes, I'll be the first to admit that classes are quite overwhelming (pure virtual destructors?, yikes!), but C++'s memory allocation and I/O makes both learning and usage of C/C++ so much easier. C++ (for the most part) handles a lot of the dirty work for you.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/30/2000 3:38:53 PM:Eli
This is nice, but really does not belong to this site.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/30/2000 3:52:46 PM:Blake Madden
This is a C++ site isn't it? Anyway, this was the first question I had when I first looked at C++, and this was the same advice that I got from numerous others when I asked. Therefore, I am sharing that advice to others now. I thought the reason people come here is to find answers to his/her C/C++ questions.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/14/2000 12:43:14 AM:aramas@ace-net.com.au
Hey, I got a copy of a friends old MSVC4.1 compiler. I really want to learn C (already great at VB) and I have checked out a few tutorials and books, but is there a better way to lealrn? how did all you gusy learn C ?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/4/2000 8:44:28 PM:Dan Corkery
Thanks Blake for advice on
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/4/2000 8:49:30 PM:Dan Corkery
...Don't know what happened there...my message didn't appear! Anyway,...all I said was that I found your advice good and, being a "Newbie" to programming(having never read a book yet), I think sites such as this should cater for both those who know and those who don't! As I said..it's a shame they didn't teach this stuff to us when I was in school!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/8/2000 9:46:36 AM:andy
I dont how those guys can say this article is irrelevant or not to post it.. This is exactly what I was trying to determine and the consensus from all sources seems to be NOT to learn C first, unfortuneatly I have yet to come across a C whoa to go tutorial, most assume C knowledge. Thanks Blake.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/29/2000 2:50:47 PM:Mike
I have to agree with Andy, Dan and Blake. This is exactly why I come to PSC, to answer my questions. I'm a VB programmer trying to learn C/C++, and the first thing I thought of was,
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/29/2000 2:53:46 PM:mike
Dont know why that dropped out like that, what I said was.... the first thing I thought was HEY, PSC might have some general answers on how best to learn. This place is for coders of all levels, not just for those who don't know. Thanks Blake! I appreciate the knowledge you have shared with us all.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/14/2000 9:37:05 PM:AngelsMajestic
Just thought I'd add my 2 cents worth. I've been learning VB and now want to learn c/c++. Didn't even know there was a difference between the two c's. Call me dumbo, but I for one am sure glad this was posted. Now I have a somewhat better concept of this c thing. And I think I'll try the ++ one first. Thanks for considering us newbies..,
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/19/2000 10:46:02 AM:master control
I learned C++ by reading The C++ programming lanaguage by Bjarne Stroustrup. This book starts the first couple of chapters on basics (like learning c with modifications) then jumps into the objects and polymorphism. If you know VB, you'll pick this book up quick. Greatest book ever. Oh yeah the author lead the development of C++. This article is an extremely important question.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/20/2000 3:37:19 PM:Ben Jacobs
I disagree and think that you should learn C first. C programs take less time to compile, are smaller, and C is easier to learn. If you want to learn C the really easy way get Dan Gookin's "C for Dummies Volume 1." It starts out at an extremely basic and easy to understand level and works up, still explaining everything great.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/23/2000 1:28:16 PM:Cheetah_Research
I just wanted to say thank you that it has been helpful for us newcomers to programming to wonder if C or C++ is the area to start, I was told C first before, but if you have an overall structural knowledge of logic, C++ I see now, should be no problem, thank you for considering and helping us confused newcomers in the field of programming, especially us hard working mothers, like me!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/28/2001 10:42:52 PM:Rodolfo
Great post. Exactly what I was looking for! I'm a VB programmer, and I was wondering about: "what should I learn first?"... Now I realize that the best thing to do is to come from the highest level language (such as VB) and then to go to the lower ones, like C++, then C, then Assembly... Thanks!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this article has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular article, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | C/ C++ Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.