xTractatorix wrote:So which one should learn?
My friend was telling me to learn C instaed of C++ because he says that C has more things in common with the other C languages, like C#,C++, etc, than C++ is this true? I am interested in learning how to write worms,and other complicated algorithoms, is C better at making these types of programs? Lastly can anyone point me to a good website from where to learn C or C++.
shaqywacky wrote:I would suggest C++. C++ is essentially C with classes. They are so similar that C code will compile on a C++ compiler(but not the other way around). If you learn C++, you know C.
HAHA. Sorry. But if you know C++, you do not know C. They are extremely similar, and all C code is compatible with C++, but C++ code is not compatible with C (much like you pointed out). However, C++ introduces several easier methods of doing things that C just doesn't have. Generally, people learning C++ get very comfortable with these methods and never learn the C way (char array vs string, structs w/ function pointers vs classes, string concatenation, etc. ). Because of this, when many developers make the switch to C from C++, they have to relearn the entire language, essentially.
shaqywacky wrote:So you've pointed out exactly what I said but then said it was wrong? Hmmm. As I said in my post, C++ is C with classes. The only differences you have pointed out are classes. If you LEARN C++ you should be very ready for C. I don't know what shit devs you are around but the ones at my work all learned C++ and can easily write C. I have never read a book or anything about C yet I have written many programs in C. And I honestly don't know how you would learn C++ without learning about c-style strings. If you didn't know how to use c-style strings, it should take you 5 minutes because you should already know about arrays, now add a null byte to the end.
I'm sure there are many differences between C and C++ beyond classes but to say that you know C++ but have to completely learn C after is ridiculous.
shaqywacky wrote:I did counter them, they were all examples of classes which I already said was the main difference between the two.
As for string concatenation, I'm not sure what you mean by this. I always used strcat() which is available in C and C++.
Whether some people forget or choose to not learn the parts of C++ that are similar to C in favor of using easier methods is irrelevant, those other parts still exist. C++ has many more libraries than C that make things easier but that doesn't mean the ways that don't use the libraries don't exist anymore.
You say the syntax is the same, and that's mainly what I was referring to. I was just noting that if he learned C++ he wouldn't need to learn a whole new syntax for C.
Users browsing this forum: No registered users and 0 guests