PDA

View Full Version : How much C before C++?


anibal187
08-27-2005, 07:18 PM
Hi, I'm studying C. My question is: How much should I know of this language before moving to C++ (my "real" goal). Which concepts should I use, pointers? arrays?...
I always find that C helps to better understand C++. I'm just not sure when is the right time to move.
Thanks for your help.

mummey
08-27-2005, 07:21 PM
No reason to wait anymore. Just to go C++.

Stevemeister
08-27-2005, 08:42 PM
Learn C quite thouroughly I say. The Win32 API is C-based, LightWave's and many other graphics SDKs are C-based as well. When you need C, it'll be there for you. So at least cover the things in C that C++ and the STL makes obsolete (like the string and memory functions and stuff).

anibal187
08-29-2005, 12:23 AM
Thanks for the replies guys. IŽm going to mix both. IŽll learn some more C, then start reading about C++, and when I notice something I should know from C, IŽll review these concepts. :scream:.

Niklas Collin
08-29-2005, 08:15 AM
I agree that go on to C++. No need to study C if you're ultimately going to use C++ anyway. And IMHO you'll just learn bad habits with C when you move on to C++. For example, no reason to use printf when you have cout and so on. You'll do yourself a big favour if you'll get object orientated programming into your workflow as soon as possible. It makes a HUGE difference when your programs go beyond 3-4k lines.

stew
08-31-2005, 08:15 AM
And IMHO you'll just learn bad habits with C when you move on to C++.
I second that. If you want to do C++, don't bother to learn C. Otherwise your coding style will be spoiled with lots of C habits that are not wise to use in C++. The difference between C and C++ is not just about using class instead of struct as some people seem to think but also about different ways of casting, not using malloc(), using STL strings instead of strcpy, etc.

anibal187
09-02-2005, 11:05 PM
Ok. I'm moving to C++. Problem is I often find books on C++ to be aimed at seasoned programers. I studied Graphic Design and the little I know about programming comes from some books on C and ActionScript (Flash's). On the other hand, C books normally are targeted to people more like me.
So as I study C++ I keep studying and researching about programing in C.

MK2
09-03-2005, 01:59 PM
Hello,

iam learning to program atm. (in a school). We first learn a bit of C, then we move to C++ and finally to Java and maybe C# or something.
A guy in our class asked the teacher why some ppls say that C is "bad" and that he should move to C++ directly.
The teacher explaind it like this: We learn the basics of C (and assembler) to understand the basics of structoral (?) programming then we move to Object-Orientated, because there is allways some structure in an Object. But he understands that people that have coded 10+ Years in C have problems with OO-Programing. Overall it is never wrong to learn a bit of everything, because you never know where you will work in future.
A nice example would be this...
Most Banking-/Insurance-Systems (mainframe-stuff) where programmed in Kobol, the problem now is that there are only a few people left who really can work with Kobol at this level. This is the reason why you need to learn Kobol again in a vocational education for a bank.
I personally think that he is right and a good programmer learns the diffrence between the progs. and knows how to optimze his code. Iam no highend coder so maybe my point-of-view will change in the future :)

Fides
09-04-2005, 02:18 AM
Problem is I often find books on C++ to be aimed at seasoned programers. I studied Graphic Design and the little I know about programming comes from some books on C and ActionScript (Flash's). On the other hand, C books normally are targeted to people more like me.

I would recommend Practical C++ Programming from Oreilly. (http://www.amazon.com/exec/obidos/tg/detail/-/0596004192/qid=1125796553/sr=8-1/ref=pd_bbs_1/002-4002397-5267260?v=glance&s=books&n=507846) It's good for beginners and has a lot of advanced concepts.

anibal187
09-04-2005, 03:18 AM
iam learning to program atm. (in a school). We first learn a bit of C, then we move to C++ and finally to Java and maybe C# or something.
Thanks for the reply.
What do you mean by "a bit". I'd like to know what concepts did you cover before moving into C++.

Fides thanks a lot for the book and the link. I'm going to buy it as soon as I can.

MK2
09-05-2005, 02:31 PM
@anibal187:

hi! yes, learning a bit is very undefinied... hmm, okay we have two books. One you can buy in any shop (C-Programming, André Willms, ADDISON-WESLEY, ISBN: 3-8273-1405-4) and one that is from the school itself. Both saying that you can make your own tools in C or you can take it as a base to learn C++.
As far as i can see both books explain all the concepts you need to know but without going to deep into it... (its good to have a teacher if you dont understand something).
pointers, arrays, vectors and so on... everything is there.
I cant explain how deep we are going into it... we have 81 Lessons in C then we move to C++ and then to Java.
But at the same time we also learn HTML, Security and Database (SQL,PHP) stuff. At the end we are able to combine all these things (which also will be the final test, b4 we get our certification).
The whole stuff is done in 2 years... normally you have 4 years for it because it is the niveau of an apprentiship position (<- i hope this is the right translation).
.
What we dont learn is specified stuff like 3D-Engines or Music-Stuff (like VSTi's) etc. but after the school we should be able to learn that by ourselfes without bigger problems (at least our teacher said that...)
.
I know this doesent help you much in your question if you should "advance" to c++ but maybe it gives you an idea how much c you learn in an official school.

anibal187
09-08-2005, 07:27 AM
Thanks again MK2.
Yeah, it is good to listen how you learn this stuff at school.
Looks like you are on a full Programming Degree or something, sound interesting.
Learning C helped me a lot even with ActionScript (Flash), so IŽll keep reading as much as I can while IŽm on C++. :thumbsup:

billrobertson42
09-15-2005, 12:53 AM
This is the best "second" book on C ever written:

http://www.amazon.com/exec/obidos/tg/detail/-/0131774298/002-7440700-6512862?v=glance

If you understand what's in that book you will have all the C foundation you need (skip the bad advice at the end about c++ though).

This is a great book on C++.

http://www.amazon.com/exec/obidos/tg/detail/-/0201309831/qid=1126741578/sr=8-1/ref=pd_bbs_1/002-7440700-6512862?v=glance&s=books&n=507846 (http://www.amazon.com/exec/obidos/tg/detail/-/0201309831/qid=1126741578/sr=8-1/ref=pd_bbs_1/002-7440700-6512862?v=glance&s=books&n=507846What)

What makes it so great is that it explains OO concepts in a manner that makes sense. It also explains a lot of the things you need to understand about C++ too.

I have not read this yet, but I understand that this book is good:

http://www.amazon.com/exec/obidos/tg/detail/-/0201704315/qid=1126741838/sr=1-1/ref=sr_1_1/002-7440700-6512862?v=glance&s=booksAnd if you want to be a true C++ guru, you will go here:

http://www.boost.org

and get all the well written C++ libraries you could ever want so you can focus on getting your task at hand done and not wonder what strange C++ rule you could have violated that makes your stuff crash.

Good luck

lxcid
09-30-2005, 10:50 PM
I didn't read the whole thread, so I don't know what had been said and what had not.

If you have not already know, C++ is from C. Learn C is like learning C++, and so is learning C++ is like learning C. I know there's some different but its not significant. C++ basically add alot more stuff into C. C++ is today's programming practices, Object-Oriented Programming (OOP). C is functions and functions, no OOP. C and C++ is like WinAPI and MFC. WinAPI is all functions and structs while MFC is all classes and objects. But MFC is derived from WinAPI. (If I'm not wrong) I know its getting really confusing for some people here. I will not explain further.

The bottom line is, there's no how much C before C++. learning C is equal to learn C++ and vice versa. Its more like you what type of programming practice you want to learn? functions (past) or object-oriented programming (present)? If you want to learn OOP, C++ is the only chioce, if you want to learn functions programming either of them would be fine. But why wait? Need I repeat that sentence again?

fred_lemaster
10-01-2005, 02:27 AM
I must respectfully disagree with you lxcid. Programming is not just syntax. You must also learn the proper idioms and practices. The way you go about using C in production is very different than the way you should structure an equivalent C++ project. I/O is generally handled completely differently between the two languages, for example.

Though it strays into a "which is better?"-debate this (http://lambda-the-ultimate.org/node/view/663) thread on lambda the ultimate should at least illustrate some of the differenes in aproach between the two languages.

lxcid
10-01-2005, 08:48 PM
Well, its all based on personal chioce I think. You doesn't have to use objects when using I/O in C++. You can still choose to use C. I preferred using printf to cout in C++. I haven't had a problem with using C coding in C++. I like using C coding because I think objects suck more memory while I always encapsulate the C coding in classes. Afterall, I was taught to be OO. In my codes OO is used more for organization and readability. I still used C coding for most stuff. I think thats why people like to say "C/C++" because we really used both of them in coding. (Correction, when coding in C++) The link you post is a much bigger topic rather than comparing C and C++. Though there's some replies on these topic, many of the reason is because of Working Environment, Platform Portability, Adaptivity, amount of Support, community preferences, some incompatible issue between C and C++ (Which I haven't meet one before), Level of errors generated, compiler issue, memory, etc. Many are inter-related. These are beyond my knowledge and control then. You have to choose and select wisely if these does concern you. Other than that, I still think they are very much alike when it comes to what exist in both language. (Of course, things like template and classes that are not found in C you can't compare them.)

If you learn C and than move to C++ you will be learning back alot of C. C++ is not like 90% C, its more like 80% or 70% or 60% (This is not the actual figure. I'm just showing something) This new in C++ are Classes, Templates, Operator Overloading, OO concepts, Exception handling, etc, etc. These aren't small topics. Unless you going for complete understandability between the two languages, I suggest straight goes into C++. Just my 2 cent.

CGTalk Moderation
10-01-2005, 08:48 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.