(e-mail address removed) ha scritto:
I am a newbie to programming, and sorry again that I have to ask the C
or C++ questions. Is C required before learning C++? And become better
in C does it also make you a better C++ programmer? Or that to be a C+
+ programmer, it's better not to have any knowledge of C and start a
new in the C++ way as some books suggest?
I know many persons that can program in C++, but I don't know a single
C++ professional programmers that cannot program in C.
I think that the only persons that can program in C++ and cannot program
in C are hobbyists or persons who studied programming but never practiced
it as a job.
This comes form the following facts:
* The C programmers and the C++ programmers markets overlap. Often a
company needs a person that is proficient in both, and often C++
programmers are hired to write software in C.
* Many libraries used by C++ programs have a C interface.
* Many libraries built using C++ must have a C interface.
* A lot of code, originally written in C, now has parts in C++ and parts
in C or in C-like C++.
* Many (old) programmers used C in the eighties and nineties and then
migrated to C++.
Therefore, I recommend to learn also C to everyone who wants to become a
professional C++ programmer. It's not important to order, but it's
better to know both.
In addition, I think it's far easier to learn C++ when you know C, than
when you know only another language. But it's also far easier to learn C
when you know C++. So the time to learn both is much shorter than the
sum of the times to learn each of them.
And I think there are never concepts to be "unlearn", just to be "set
aside". For instance, many say "in C++ you should forget about malloc";
but a lot of literature talks about malloc, and if you don't have an
idea of what it's talking about, you can't understand that literature.