C or C++ I have lost my mind.

Started by
26 comments, last by LostSoul 24 years, 2 months ago
I am no good at expressing my ideas in a written form, let me try to be simple and clear. Should I learn C then C++ or should I go right for C++? I understand that C++ is a superset of C. And if I knew C++ I would have to already know C. But this isn''t entirely true. I have a book that teaches OOP from chapter one, they don''t cover any C stuff, example they don''t teach the printf function, they go right for using cout, cin, etc. They don''t bother with telling you how to code in a non-oop format... Which means after learning C++ from this book I will not have the ability to read C code because I will not understand the format... If I read this book I will know all of the C++ language, but still not know C if you understand what I mean..... I don''t know what to do, and I know I can''t explane things very well so if you need me to clear something up please just ask and I will do the best I can to help you.... LostSoul
LostSoul
Advertisement
I believe that if you learn how to program in C++, then you should have no problem reading C code. Within the C++ OOP methods is C code.
William Reiach - Human Extrodinaire

Marlene and Me


Your best bet is to learn C++ first if you have the choise. It is a superset of C, which means you can read C code. As far as the libraries go, don''t let that scare you off. You should be much more concerned with the keywords and the syntax at this point.

Here it is simply, I started off with C++ and I never regret it. That''s my best advice.
for the most part, c by itself is dead. so learn c++, there would be no point in just learning c.
quote:Original post by Int86x

for the most part, c by itself is dead. so learn c++, there would be no point in just learning c.


C is hardly dead. Much of the code I work with every day is written in straight C, even though most new code is written in C++. As far as the original question goes, it has long been my opinion that you should learn C++ first; the biggest argument I''ve heard against doing so is that OOP can be confusing. However, most C++ books and classes I''ve encountered teach procedural programming first, and then move on to classes and OOP later. As long as it''s done that way, I think learning C++ first is fully appropriate. Then, at some point, you should go back and learn exactly how C is different, so you can understand and write straight C code if you need to.

Look in our Featured Articles section for John Hattan''s "Which Language Should I Use?" for an excellent discussion of this topic.
I went for C++ and I don''t regret it.

C is dead! There is no need to write C-code. C++ is better and if you understand C++ you understand C so there is no problem when you are maintaining some old C-code
I would suggest you start with C++. My very first serious programming language was C++. I found little difficulty in understanding C++ - I was about 14 years-old back then. Last year in college, I studied C and found it also easily understandable because of my C++ knowledge. Nonetheless, C makes learning a little more difficult since you have to worry about the trivial details like that of the printf statement i.e. %s, %c, %d and so on. C++ has this complexity minimised with cout. So, I guess your best bet is with C++.

Best regards,
Sherman
_________________ Best regards, Sherman Chin Director Sherman3D (Malaysia) Sdn Bhd www.Sherman3D.com www.AlphaKimori.com
GunnarStein: Be careful not to associate all languages with the same style of programming. OOP and procedural methods represent two different programming paradigms, and each has it benefits and weaknesses. C is often considered to be the language of choice for writing fast procedural programs. Saying that C is dead is like saying that the procedural programming paradigm is dead...a statement that would be hard to back up (yes, there are situations when the OOP paradigm is NOT good, let alone not optimal). Procedural programming will not just go away because everyone is really high on OOP right now.

That having been said, C++ is my language of choice for most applications. I actually learned OOP by using LISP and JAVA, and so C++ was a natural, although messy, next step. Speaking of obsolete languages, anyone used LISP lately? Anyone heard of it? No...then why does it persist as one of the most important languages around...
------When thirsty for life, drink whisky. When thirsty for water, add ice.
Well said, Graylien.

And yes, a few of us use LISP on occasion, still
Damn, I used LISP last semester. I hated it.

Kevin

Admin for GameDev.net.

This topic is closed to new replies.

Advertisement