Jump to content

  • Log In with Google      Sign In   
  • Create Account


C or C++ I have lost my mind.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
27 replies to this topic

#1 LostSoul   Members   -  Reputation: 122

Posted 11 January 2000 - 07:25 PM

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

Sponsor:

#2 Gromit   Members   -  Reputation: 144

Posted 11 January 2000 - 07:50 PM

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.

#3 I-Shaolin   Members   -  Reputation: 138

Posted 11 January 2000 - 09:36 PM

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.

#4 Int86x   Members   -  Reputation: 122

Posted 11 January 2000 - 10:02 PM

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

#5 Dave Astle   Senior Staff   -  Reputation: 2305

Posted 12 January 2000 - 03:41 AM

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.

#6 GunnarSteinn   Members   -  Reputation: 122

Posted 12 January 2000 - 04:04 AM

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

#7 sherman   Members   -  Reputation: 151

Posted 12 January 2000 - 05:37 AM

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

#8 Graylien   Members   -  Reputation: 160

Posted 12 January 2000 - 09:37 AM

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...

#9 Dave Astle   Senior Staff   -  Reputation: 2305

Posted 12 January 2000 - 12:37 PM

Well said, Graylien.

And yes, a few of us use LISP on occasion, still

#10 Khawk   Senior Staff   -  Reputation: 1360

Posted 12 January 2000 - 12:41 PM

Damn, I used LISP last semester. I hated it.

Kevin

#11 Notwen   Members   -  Reputation: 122

Posted 12 January 2000 - 12:46 PM

For that matter, not everyone is high on OO Languages and C++. There are tons of development shops that still deal exclusively in c. Still others profess to use c++, but place so many restrictions on its use that they are basically c houses with a few nice features added on top.

I would suspect that good programmers, well grounded in software design methodologies write good programs and that while languages may help or hinder this, they are not the backbone of it. No language makes up for poor engineering.

Notwen

#12 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Posted 12 January 2000 - 01:15 PM

Hey, I want to only learn one language, I know C is C++ w/o the superset just like the other guy but there are still books that teach only the C++ way to do things and stuff..
And since I don''t have to go by the requirements of game companys (c/c++ and asm knowledge) I only want to focus on one language, plain C or C++ ? then if I get good at either one, I may learn the other or something..

Most people say out of preference, but since I have no past experience, I have no preference on which language to use. Which one would you suggest I use? some people say things like C++ code is cleaner, C is faster, C is more portable, C++ is better, blah blah..whatever..


#13 Potsticker   Members   -  Reputation: 122

Posted 12 January 2000 - 01:31 PM

Well, you''ll get into a circular loop and not reach a decision like this. But if you are going to just pick one, just pick C++. Why not?

You can write procedural programs with C++ btw. It''s not like Java where you have to have an OO approach.

The other side is what are your immediate objectives? what do you want out of the language? What kind of games do you want to develop. If you don''t know, then C++. If you do, there could be some consideration for C.

#14 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Posted 12 January 2000 - 01:58 PM

Lost soul I think I know what you are talking about.I started with C++ not to long ago it wasn''t to bad, but then got game programming for dummies which was pretty much C.Spent alot of time looking up stuff like printf.If you have the money I would get The Complete Reference C++ Third Edition it has a C subset in it.Just look in index and turn to the page.I wish I would have got it to begin with would have saved alot of time. And if you are new to C++ you will find you have only scratched the surface.

#15 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Posted 13 January 2000 - 01:54 PM

quote:
Original post by Potsticker

Well, you''ll get into a circular loop and not reach a decision like this. But if you are going to just pick one, just pick C++. Why not?

You can write procedural programs with C++ btw. It''s not like Java where you have to have an OO approach.

The other side is what are your immediate objectives? what do you want out of the language? What kind of games do you want to develop. If you don''t know, then C++. If you do, there could be some consideration for C.


Hi Potsticker, I want to make 2d games I know that, without the hassle of all these languages, so I can focus on one then choose to go onto the next, I''m just going to do this as a hobby like alot of people. I want the games to be fairly big, and have good graphics effects like stuff from photoshop, have quite a few different characters, guns and stuff, so maybe some platform games, 8 or more directional games..just games that I could maybe put on a webpage and that people may like to play in their spare time..



#16 SiCrane   Moderators   -  Reputation: 9423

Posted 13 January 2000 - 02:57 PM

If you''re programming in Windows, there''s no reason not to learn C++ first. In UNIX/Linux learn C first. Quite frankly it all comes down to which language bindings for APIs, etc. are more appropriate and in the Windows world it''s all going towards C++.

But for all you, OOP freaks out there, it''s perfectly possible to program OOP in C, especially if you''re willing to give up the multiple inheritance.

But here''s a link from the man himself about C++ as a beginner''s language: http://www.research.att.com/~bs/papers.html

[offtopic] LISP is dead! Long live scheme! [/offtopic]

#17 Stoffel   Members   -  Reputation: 250

Posted 14 January 2000 - 05:44 AM

I learned C and used it for about 7 years before moving on to C++, and always felt my C habits were holding me back. Granted, it''s good to know some C tricks, and there''s the benefit of having a very good notion of what the compiler will do with every line of code (not so, I feel, with C++). All in all, I wish I had learned C++ first. My excuse is that there was no C++ standard when I started. =)

#18 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Posted 14 January 2000 - 06:03 AM

You should go ahead and start with C++. If you are going to be a windows programmer, learn the basic structure of the C language, pointers, functions, classes, structs, etc. When you start programming windows, you''ll notice that pretty much all of the IO functions including cin, cout, printf, scanf, and all the FILE stuff no longer works. I suggest that you learn the basics, and then get Visual C++. Use the online help and tutorials. You''ll be a master in a month or two. Try writing code that takes care of the windows overhead. I''m writing a library that simplifies Windows. Its pretty large.

Dominque Douglas

#19 Glandalf   Members   -  Reputation: 122

Posted 15 January 2000 - 05:11 PM

If you want to get a good book on OOP w/ c++ and want the basics in c get SAMS Teach yourself OOP w/ Wisual C++ 1.5 in 21 days, its not hard to learn the new keywords and it has a great c review in the back of the book that helps when reading c code.
Glandalf

#20 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Posted 16 January 2000 - 03:35 AM

What Im doing is learning C then C++.

I have bought C for dummies and C++ for dummies.

Then Im getting a Visual C++ book and learning from that.

I guess people have different ways of learning languages to me though.


SNEAK





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS