Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C/C++, which one first
#1
I need to learn C/C++ by the end of this year for my course next year, enough to pass a 3 hour test. I was wondering which I should learn first, or doen't it matter. Also does anyone know of any 'from BASIC to C/C++ tutorials'
Reply
#2
Rule #1: When learning a new language, forget everything about other languages. Just keep algorithmics on mind.

I'd go for C, then C++, as C++ is just C with added junk. You understand C, you'll understand the add-ons.

Learning C will help with your fB coding as well, as mastering the simple concept of pointers and dynamic memory management will open lots of doors Tongue
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#3
I'd say learn C++. It's been one of the more predominant languages right now - especially for games - so there is a vast wealth of information available to you.

C is very different from C++. Good/practical techniques in one are not necessarily good in the other. C++ is not just "C with classes", it's a multi-paradigm language that supports different kinds of programming than C (which is procedural). When you're learning C++ the "right way", imo, you'll find that the only similarities to C are some syntax.

Also, I would say that to get started in either language, the learning curve is not as high in C++ (it's alot easier to create a safe dynamic array in C++ than it is in C. plus, you'll be using already tested implementations with your C++ standard library).

Additionally, learning C++ - as opposed to C - will make it easier to migrate to languages like Java, or C#.
stylin:
Reply
#4
Well I have begun to learn C. I know enough to make games now, crapy games at that cause I can't get conio working which is a major pain in the butt.

Anyone know of a small (smaller than 10mb) C compilier and IDE, one that can use conio preferably.

Also are there any good libraries I could use for graphical 2d game creation, or any that would be helpful.

One more thing, what is the point in having pointers, apart from pointing to memory locations and linking with variables, whats the use really?
Reply
#5
I would suggest C on the fact that most C++ code I've seen is really just C code with some OO tacked on that could have been replicated using other data structures.

Unless you are really gung-ho on OO C++ is kind of a bother.
$0.02
i]The short answer is 'Yes.' The long answer is 'No.'[/i]
Reply
#6
Quote:most C++ code I've seen is really just C code with some OO tacked on that could have been replicated using other data structures.

Yay! You're on my team! Big Grin
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#7
Hmm, you two need to see more C++ code ...
stylin:
Reply
#8
I deal with C++ all the time, I understand the whole different paridigm of programming idea. It's completely valid, but from the code that I have work with it seems to me that many of the people who work with C++ don't, hence they use those different tools (OO in particular) when they don't have to.

It's all an issue of elegence. Just because you can use a tool doesn't mean you need to. Most people don't get thier heads completely around C++ and so that becomes a liability to thier coding. C has less tricks about it and lets people mong cleaner code.
i]The short answer is 'Yes.' The long answer is 'No.'[/i]
Reply
#9
i can tell you after working on a medium sized project (LL, 20k lines without comments/whitespace) that OOP would be invaluable in FB.

OOP is necessary like a chisel is necessary. sure, you could use a flatheaded screwdriver, and it will get the job done (with more effort, more chances to f*** up), but the "chisel" is made for the job.

OOP is made for organizing, encapsulating, genericizing (not a real word), but of course not 100% blaze efficency in every case. You want that? Code in ASM. And then cry when the code you make has to be rewritten all the time to suit special needs when things like templates or function overloading would've reduced the amount of work by a magnitude of 5 or 10 or 20.

Keep in mind, I don't routinely program in c++, FB is my language of choice, but I've learned about the paradigm, and it's really a shame that it hasn't been embraced yet.* Finally web coding seems to be with things like XML. Dividing the data from the code. Encapsulation. Just like seperate objects.

When FB gets OOP I'll show you. ;P

*By many BASIC programmers? ;P
Reply
#10
Quote:...from the code that I have work with it seems to me that many of the people who work with C++ don't [fully understand it], hence they use those different tools (OO in particular) when they don't have to.
The way certain people program in a language doesn't have anything to do with the usefullness of that language. I've seen alot of crappy, wasteful and unsafe C code in my time, also; doesn't mean C is all those things.

Quote:It's all an issue of elegence. Just because you can use a tool doesn't mean you need to. Most people don't get thier heads completely around C++ and so that becomes a liability to thier coding. C has less tricks about it and lets people mong cleaner code.
Again, I think it's wrong to say that a language is a bother just because there may be some people that don't know how to use it properly. I would give the OP the benefit of the doubt.

I don't know what you mean by tricks (or "mong", for that matter), but to do some of the more basic and elegant things in C++ - like polymorphism, for example - requires a level of knowledge of C that is much greater than either a beginner or intermediate programmer. C++ takes much of the work involved in memory management and does it for you, unlike C where memory management is always a top-level concern.
stylin:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)