Saturday, May 22, 2010

Which One's better C/C++?

I have a little programming experience in HTML and Liberty BASIC, but I'm getting into one of the C languages, and I don't know whether to start learning C or C++ please give me some advice, along with a good book/web resource for learning these languages. Please keep in mind I preffer a "for dummies" kind of thing, but I would really like something online, also explain why you think the version of C you stated is the best. Thank a bunch

Which One's better C/C++?
C++ is for object oriented programming and very powerful, C is not. Right now everything almost move to OOP (object oriented programming).





As for resource just search online, there are plenty of resource about C++ or even C. They've been around for very long time
Reply:C++ is much better than C cuz it offers object oriented programming to some extent.


If you have doubts just go to cplusplus.com and clarify the doubts.
Reply:C++ adds Object Orient stuff like classes and inheritance.





But the major difference is the standards. C++ has high level things like out-streams (cout) and file streams (fstream) etc. etc. While C outputs with printf and file operations with functions. Instead of classes like C++.





Not to mention C forces you to write your code a little less streamlined (for example, I can't write C variables in the middle of a function, but in C++ I can)





There is no difference in learning curve, you will learn the basics of C in any tutorial, but using the powerful cout stream then move into classes, inheritance and other C++ things later in the tutorial. With a lot less syntax errors that are obscure (like placement of variables)





Here is a great tutorial


http://cplusplus.com/doc/tutorial/





That handles everything except function pointers (that I know of)


It also has a comprehensive standard and stl reference documents.
Reply:C++ is object orientated, where C can only use test to display messages. There are advantages and disadvantages to both. C is more a mid level language, where C++ is a high level language. All of C is included in C++ so I would recommend starting with C. Just my 2 cents
Reply:c++
Reply:It's been said that C generates smaller, faster code than C++. Yet C++ has higher level tools for managing and implementing complex problems and large business problems/solutions. So, it might depend of the nature of the programs you'd like to create.





((((((((( Some will rail at me for suggesting C++ might be bloated or sluggish code. But really, how many games developed in C++? ))))))))
Reply:I'm sorry, but the answer is yes. I was taught C in college. As I graduated they finally got their hands on an affordable C++ compiler and introduced it the semester after I left. I've had to pick it up on my own and I've noticed there are things I haven't wanted to.





I've never totally assimilated, and I've noticed several other gray-hairs who tend to be somewhere in between. I've also noticed younger people who were trained in C++ will write the same sort of codes using the same routines but call it C++. I don't see that as indicating that C is better, rather that different tools are useful for different purposes. The best advice is spend money on a college course. And let the school decide for you. Then study the other. Having said that I am linking to a place called C++.com which has lots of good documentation about both sets of libraries.


No comments:

Post a Comment