Mail Archives: djgpp/2002/01/29/08:16:33
Jeroen Vandezande wrote:
> I am learning C and will soon convert at my work my old Turbo Pascal Progs
> to C/C++
> but what should I use C or C++?
> A friend told me NOT to use C++ if I was not going to use Classes and
> Objects... but just use C...
Hi, I'm that friend :-) And I want to add some points to this
discussion. Some things other people said:
Gautier wrote:
> Try both and don't trust your friends:
He doesn't, that's why he posted here :-)
> they always will
> recommend the language they are using most.
No, I used both C and C++ in the past, amongst various other languages.
Nowadays I'm a full-time Java programmer.
Eli Zaretskii wrote:
> > "Except for minor details, C++ is a superset of the C programming
> > language."
>
> Those ``minor differences'' make a world of difference in some
> cases. For details and some examples, see section 8.4 of the DJGPP
> FAQ list.
That section only talks about //-style comments. These comments are not
standard C, but some compilers (like DJGPP) do support them.
Last quote: one2001boy wrote:
> C is for low-level system programming and embedded systems;
> Ch is for script computing
> C++ is for large-scale projects;
And this brings up my most important point: Jeroen did not mention in
his question what he is working on. He is programming on embedded
systems. It's not the lowest level, the machine he is working on uses a
"PC on a chip," with some 486-compatible processor.
Considering this, and the fact he was not going to use OO-features like
classes, I advised him to use plain C. I thought this would be more
easy to learn, and as C is (+/-) a subset of C++, he can always evolve
to C++ later on.
I also thought C code would generate smaller and/or faster code (correct
me if I'm wrong), which would be for the benefit of an embedded system.
Regards,
David.
- Raw text -