September 2nd, 2003, 07:20 PM
What about Learning C++ before learning C or after?
I must thank all those who helped in making that huge forums ..
I was thinking if i should learn C and then go ahead and start learning C++ ,, Or learn C++ and then C ,, I don't know what is better ,, i have already started in C++ but if anything better i can do i WILL... thats it .... but i got another question .... What is obj-c ... the diffrence from c .. advantages ...
thanks for reading this
I hope that subject is suitable about what inside.....
September 2nd, 2003, 07:40 PM
I'm not sure about your other questions, as I'm just starting to learn C++ myself. But, I too had the same question about if I should learn C or C++ first.
I found out that the creator of C++ and a few other people say it is not neccessary to learn C and that it may be to your advantage not to learn it also. The reason being that some things you learn in c are not needed in C++ or can cause bad habits that are hard to drop...
Hope I helped some,
September 3rd, 2003, 03:54 AM
thanks for your reply
well ... i got a book says learn c++ in 21 days ... and i just finished the first 3 days .... talking about declaring variables and and diffrence between int char and unsigned and signed and constants .... it is good until now .... i met a guy and he says the same you just told me .... and i think i will learn C++ ... have you learned the functions or not yet ...
September 3rd, 2003, 02:07 PM
Actually no. Infact I just started learning this weekend and purchased the Teach yourself in 21 days book too! I think we have the same book, I just finished day 2 yesterday.
September 3rd, 2003, 02:21 PM
i would have thought learning c++ involves, even though you're "learning c++", learning c whether you like it or not. c++ is an extension of c. c++ is made up of a lot of c, so learning c++ without knowing anything about c would be impossible i'd have thought. of course you can learn c++ in a way that happens to include the c parts and just call it "learning c++" but you'd still be larning c at the same time i think. and i'm sure there's plenty of c++ books / tutorials / courses that start out to teach the whole thing from the beginning including the necessary c parts. i say that without knowing c++ at all myself, but i do know a bit of c and objective-c. and objective-c is much like c++ in that respect i think - you wouldn't get very far with objective-c without knowing any c. obj-c isn't another language as such, more an extension of c - extra bits added on to c. restructuring of c.
object oriented languages (c++ and obj-c for example) are built on top of pre existing procedural languages (like c) and kind of repurposes / restructures the procedural language at a slightly higher level, based on the object oriented concept obviously. so c comes before the oo ones both chronologically in history, and conceptually i think. so learning c comes before learning c++ or objective-c as far as i'm concerned.
the makers of objective-c and c++, even though both wanted to make an object oriented version of c, had quite different goals. c++ maker's goals were to make an oo version of c that was efficient as possible (from the computer's point-of-view). where as objective-c maker's goals were to make an oo version of c that was efficient as possible (from the programmer's point-of-view). hense i think that c++ is harder to learn and more complicated than objective-c. if you know c well, you can learn objective-c fairly quickly and easily. objective-c has a stronger emphasis on dynamism than c++ which means putting decisions in the code off for as long as possible (to when the code is actually run mostly - runtime) rather than forcing those decisions to be made earlier, such as compile time. which is very much to do with polymorphism and weak typing.
objective-c is no where near as popular as c++ though, but gnu's gcc can compile it so it's not exactly obscure either. reason i'm interested in it, and know it at all, is because it's one of the better options for apple mac os x stuff. so it comes down to which platform you wish to develop probably i guess.
September 4th, 2003, 07:31 PM
well , I don't know anything about C or Objective -c but thanks balnace for telling about obj-c .... that i understand what it stands for ..... but it seems to me that c++ is not that difficult i read the first 77 pages in that book and it works just fine..... i wrote that simple program....
//Hi All,This is my first program i write and it is very very simple
//that i won't describe what it does
//about adding and multiply
int x, y, z, u;
cout << "Here you will show me how good you are in math , without using calc.\n\n\n\n";
cout << "Enter a number:";
cin >> x;
cout << "Enter another number:";
cin >> y;
cout << "Now, Enter the sum of those numbers you just give me\n\n";
cin >> z;
u = x + y;
if ( z != u )
cout << "You even cannot count the sum of those numbers,hehe";
if ( z = u )
if ( ( x + y > 10 ) && ( x + y < 100 ) )
cout << "\n\nthe sum of this numbers is bigger than 10 and less than 100\n\n";
cout << "\nOKAY\n";
cout << "the sum = " << x + y;
if ( ( x + y <= 10 ) || ( x + y < 100) )
cout << "\n\nthe sum of this numbers is less than 10 or equals 10 or less than 100\n\n";
cout << "\n\nthe sum = " << x + y << endl;
if ( u > 100 )
cout << "\n\nYou Gave me number bigger than 100";
cout << "Look if you wanna win , you must give me a numbers when the sum of them timed by 6 equals 2400.. ok\n\n";
cout << "Yours, Mohamed Kassem\n\n\n";
if ( u * 6 == 2400 )
cout << "You gave me number when timed by 5 is bigger than 1000 or equals 1000\n\n";
cout << "You Won!!!\n\n";
cout << "Visit geocities.com/alnokta\n\n";
tell me what do think
September 5th, 2003, 08:03 AM
Whether you should learn C at all is a question that you should ask yourself. Although balance does list some good points about C and the languages that were born from it, it really isn't necessary to learn C unless you have a need to program in C or possibly in Obj-C but as balance stated; it isn't near as popular as C++.
C++ requires absolutely no knowledge of C to be able to learn it. Although it still contains a lot of the functionality, all of the functions (if you include the required headers), it is also more flexible and allows you to do some things that cannot be done in C. I'm not talking about the obvious stuff either like classes (which is an adaptation of structs). I mean like somethings that are simple like default values in function headers, etc...
The major thing is that in most cases a lot of what you learn in C must be relearned for how C++ handles it.
input/output in C uses function calls (printf, fprintf, fgets, etc)
input/output in C++ uses streams (cout, cin, cerr, etc)
memory management in C uses function calls (malloc, calloc, realloc, etc)
memory management in C++ uses keywords (new, delete)
The point here is that although people who already know C can spend a little time and make a realtively smooth transition to C++, unless you already know C, or need C, then there isn't as much of a need to go out and learn it. Especially just to learn C++. A lot of books and schools that teach C++ don't teach it from the standpoint that you already know C, they go from the basis that you don't know either.
I personally know both C and C++ but I use C more. There is a reason behind this, I have a need for C because of the programs that I write and what they are used for.
September 5th, 2003, 11:06 AM
I would like to point out that the additional "functionality" C++ has over C isn't needed by most programmers, and C can obviously acheive anything C++ can.
A lot of good comments have been posted here, but I personally wouldn't learn C just to learn C++, the C++ books will teach you all the relative C you need to know, then move you onto C++ specifics.
I code a lot of C, this is because I don't find object orientation helpful to my ways of thinking or planning; you should give both a go and see which you are more productive with.
September 5th, 2003, 11:22 AM
This might of helpful to you
September 5th, 2003, 02:03 PM
You know Java and C++ started from C as a base , I think
you have to learn a little C (to see how things work behind) then
go and put all your effort on C++
September 5th, 2003, 02:11 PM
Uh, no. This has been discussed so many times already. You really don't need to know any C at all to go ahead and learn C++. Honestly.
September 5th, 2003, 05:42 PM
i'm sure that's absolutely right, but because c++ contains a lot of c, you would in fact, maybe even possibly unbeknowst to the learner, also be learning c to a certain extent while you learn c++, to learn c++ i think. especially at the start. even though you never decided to learn c.
there's obviously plenty of courses and books etc that will teach c++ from the start, fully, but they'll teach some / a lot of c even though it's all being done under the banner of c++. so by the time you've done that you will also have picked up a lot of c i think, even if you don't realise it. but that wouldn't be the case at all the other way round (learning c, not c++).
with objective-c i think it's exactly the same, but maybe more distinct / black and white. because the c has remained the same, in order to learn objective-c you need to learn c then the obj-c bits on top of that - and it's very obviously like that. and maybe because it's not such a popular language, or because maybe ~90% of objective-c is c, books / tutorials / cources etc for objective-c will just say "go and learn c first". but there would be nothing stopping an objective-c course teaching objective-c (including all of the necessary c) and just calling the course an objective-c one, which is what the case would seem to be with c++.
but, also, because the extra bit, the addition to c, is an object-oriented addition, even though there doesn't seem to be much extra in quantity it's a pretty fundamental difference because it restructures the c (so requires, i think, different thinking), so in some ways it doesn't seem like there's much extra to learn, then in other ways there's stacks extra to learn.
September 5th, 2003, 09:53 PM
I would have to disagree some. Yes, while learning C++ you are learning some C functions, but you are learning in some context that cannot be applied to C.
This same logic could be applied to PHP, in that the syntax is very similar to C and it has quite a few of the same functions, so in essence you are learning some C when you learn PHP. Here is the kicker though, although you might be able to apply some things you learned in PHP to C, they don't translate that easily in that PHP lets you do plenty of things that C does not. The same is true with C++ versus C. I know this from experience. I learned C++ first (because that is what the university taught), but the company that I work for does its programming in C, not C++. This meant that I had to learn how to accomplish tasks in C that I would have done in C++. Some (most) were possible, others I had to find alternate methods. i.e. one of my favorite little extras with C++ is default values in functions, that way you don't always have to pass a value, and also overloading functions, and templates, etc... None of these you can do in C, nor is there an easy way around most of them.
Now Obj-C may be best considered just an addition to the C language, it is best to think of C++ as more of a different language that was born from C, not just added to.
Another good example is the D language, which also follows the above context.
September 6th, 2003, 11:28 AM
oh ok, i think i must be meaning it in a more general / vague way then, rather than specific details.
i found php very helpful in learning c. the small amount of php exprerience that i had before deciding to learn c, made me not *quite* such a c beginner as i thought i was. so i feel now that php had taught me, unbeknowst to me at the time, some c. i know there's some big differences between php and c, but there are also some big similarities, and it's the similarities that helped obvously.