C vs. C++

Started by
33 comments, last by RogueZero 20 years, 9 months ago
Learning C first then transitioning to C++ can be dangerous if the C++ paradigm is not explained beforehand. C++ should be learned in entirety and user should decide what tool to use from the C++ toolkit to solve a problem. This will prevent people from using a hammer for every problem as is case when not all features of C++ lang. are learned beforehand. I would recommend the use of a console app for this to limit the gfx api dependance and instead concentrate on C++ methodology.

The reason I say this is because once you''re working on a gfx project it is very difficult to go back and learn new C++ features as you don''t have time to think about lang. design paradigms when you have gfx stuff to think about. Switching hats like this is very difficult when you''re learning both at same time. Learn one then the other. It''s kind of hard to learn gfx api without learning prog.lang. so learn that first then gfx api.
Advertisement
quote:
Very few? There are TONS of schools that teach C before C++, and a lot of people that go to these schools learn it in this order. I for one learned C before C++, and I know when to use the featuers of C++ and when not to, because just because they make development time faster in some cases, doesn''t mean they make the game run faster . There isn''t really a big downside to learning C, because C++ is pretty much backward compatible.


I am saying very few because percentage-wise, not many people go out of their way to find a strictly C compiler (Yah I know, visual C++ can compile straight C and give you errors for C++ things) and implement it, rather than just use a C++ compiler and write C style code.

I know, there are probably many people forced into learning C first but I have learned everything I know about programming from being self taught, and from that perspective it makes no sense to learn straight C first.

Also about C++ being the best language, sure every language has its strengths and weaknesses, but let me put it this way: C++ has very, very few weaknesses. Probably the only "weakness" I can come up with is that development time is higher than some other languages like Java and C#, but I think its worth it.
OpenGL Revolutions http://students.hightechhigh.org/~jjensen/

So you''re saying your "self-taught" method is better than a college course?

A large weakness in C++ for me is the ability for people to abuse the language. Bad C++ code is worse than bad C code.

quote:Original post by Anonymous Poster
So you''re saying your "self-taught" method is better than a college course?


Mine was.

MSN
quote:JD
Learning C first then transitioning to C++ can be dangerous if the C++ paradigm is not explained beforehand. C++ should be learned in entirety and user should decide what tool to use from the C++ toolkit to solve a problem. This will prevent people from using a hammer for every problem as is case when not all features of C++ lang. are learned beforehand. I would recommend the use of a console app for this to limit the gfx api dependance and instead concentrate on C++ methodology.


This is why I think learning C as a stepping stone to C++ is a bad idea. The idea of something called "C/C++" and that "C++ is C with classes" is very misleading. They should be treated and thought of as two different languages. (I have no problem with learning C first because it''s a simpler language to get your feet wet with programming and then moving on to C++)

quote:31337
I am saying very few because percentage-wise, not many people go out of their way to find a strictly C compiler (Yah I know, visual C++ can compile straight C and give you errors for C++ things) and implement it, rather than just use a C++ compiler and write C style code.


lcc-win32 is C only, and gcc compiling a .c file is C only (with some gcc extensions to C, but still nothing close to C++). There are options for both to make them more conformant to ISO C.

quote:
I know, there are probably many people forced into learning C first but I have learned everything I know about programming from being self taught, and from that perspective it makes no sense to learn straight C first.


I agree, if your goal is to learn C++. If you''re trying to be a better programmer, then learning a new language is never going to hurt, especially if that language is as important as C.

quote:
Also about C++ being the best language, sure every language has its strengths and weaknesses, but let me put it this way: C++ has very, very few weaknesses. Probably the only "weakness" I can come up with is that development time is higher than some other languages like Java and C#, but I think its worth it.


Worth it if you have development time to sacrifice. Businesses can''t always make that sacrifice, and I know I can''t (programming is something I do for fun, but not even close to the only thing). Also, I think some languages (OCaml, for instance) can certainly give C++ a run for its money in development time and other areas.

This topic is closed to new replies.

Advertisement