Blogs
 


  Oddworld Forums > Blogs > Re re ro ro re ro


Rate this Entry

C++

Posted 10-17-2010 at 07:16 AM by STM
Hey forum,
I was thinking of starting to learn C++ for it's game programming aspect, I've tried to learn the basics from a generic read me but I can't grasp it easily, does anyone here know how to C++ who wouldn't mind teaching me?
Total Comments 17

Comments

T-nex's Avatar
I would recommend not jumping into c++ directly. It confused me at first too. But after learning Javascript and PHP and c# I've begun grasping the basic concept of programming itself, making learning any programming language so much easier now.
Posted 10-17-2010 at 10:13 AM by T-nex

Paul's Avatar
C++ tends to have slightly more complex syntax than other languages and also gives you the burden of manual memory management. If you can deal with that then its no problem

All OO langs are pretty much the same, you just need to learn about encapsulation, inheritance and polymorphism.

So encapsulation.. is pretty much data hiding, done like so:

class EncapsulationExample
{
public:
int GetData() const { return iData; } // Allows access to the encapsulated member data, this is a very example but it could be doing something extremely complex!
private:
int iData; // Encapsulated data
};

And inheritance..

class Shape
{
protected:
virtual void PrintType() = 0; // Pure virtual method/function
};

class Square : public Shape // Inherits shape public because it "IS A" shape
{
public: // implement pure virtual methods from Shape
virtual void PrintType() { std::cout << "I am a square!" << std::endl }
};

And finally polymorphism (Imagine we have many classes deriving from/inheriting Shape).

void doSomethingWithAShape( Shape& aShape )
{
// Here aShape is of type "Shape" because it a base class type
// this means it can be an instance of Square, or any other derived class, hence when we do
aShape.PrintType(); // Will call the derived type, this is polymorphism since the call is dynamically bound, it may print "I'm a sqaure" if its a square, or anything else depending on what the derived type is!
}


The end..
Posted 10-17-2010 at 11:28 AM by Paul

Ridg3's Avatar
Languages that I'm moderately fluid in, in order that I learned; Visual Basic, Dark Basic, C++, C#, XNA.
Posted 10-17-2010 at 11:33 AM by Ridg3

STM's Avatar
Sorry Paul but even that for now, is beyond my comprehension.

thanks everyone so far =)

@T-Nex, sooo, do I start by learning java script as the easiest?
Posted 10-17-2010 at 11:34 AM by STM

T-nex's Avatar
Well.. For me it worked that way. Javascript helped me understand loops and containers and alot of basic stuff that I was totally clueless about when trying c++, and then when moving on to PHP and c# I began understanding the more complicated stuff cos it was required. You're totally new at programming, right? So I suggest javascript or PHP, but I personally like PHP more.
But also remember, you should not linger by those too much, because they seem quite irrelevant to what you want. And like others said, c++ is much more complex.

I wanna learn Java So I can make mobile games.
Posted 10-17-2010 at 12:44 PM by T-nex

Paul's Avatar
I would say go for c# since it has similar c++ syntax, and you will be using visual studio which is the same IDE you can use for c++.

The debugger is also really good too, and lots of c#/winforms/asp.net/sql jobs out there

Edit: Oh by the way, the first language I used was C, then VB6 which is very evil and now out of date, NEVER use VB6 whatever you do . Then C++/C# and many others.
Posted 10-17-2010 at 02:14 PM by Paul
Updated 10-17-2010 at 02:16 PM by Paul

Nate's Avatar
I'd suggest Java as an introduction to Object Oriented programming. It's similar enough to C++ that you can pick up the syntax fairly easily in the future.
Posted 10-17-2010 at 05:57 PM by Nate

Xavier's Avatar
Just wondering, I can program in C and Java, how hard would it be for me to learn C++?
Posted 10-18-2010 at 12:34 AM by Xavier

Paul's Avatar
If you know any OO lang then it should be piss simple since all the concepts are the same. There is nothing magical or extremely difficult about C++ .

You will want to delete all C knowledge from your brain though.. i.e do not use malloc/free/globals/return codes instead of exceptions and so on.
Posted 10-18-2010 at 01:01 AM by Paul

Nate's Avatar
:
Just wondering, I can program in C and Java, how hard would it be for me to learn C++?
As Paul said, it's really easy. The only big differences are the syntax of defining a class, improved dynamic memory allocation and simplified I/O and string handling.
Posted 10-18-2010 at 03:13 AM by Nate

STM's Avatar
kk thx all
Posted 10-18-2010 at 09:46 AM by STM

Wings of Fire's Avatar
Master the english language before moving on to any others, please.
Posted 10-18-2010 at 10:37 AM by Wings of Fire

T-nex's Avatar
Now now, Joe > This is no time time be a dick.
Posted 10-18-2010 at 12:38 PM by T-nex

Wings of Fire's Avatar
However it's probably a good time to learn to use the Disable Emoticons button.
Posted 10-18-2010 at 03:30 PM by Wings of Fire

Phylum's Avatar
I think STM's the dick for not using English.
Posted 10-19-2010 at 01:25 AM by Phylum

MeechMunchie's Avatar
Racist.

Shut up WoF.
Posted 10-19-2010 at 09:07 AM by MeechMunchie

STM's Avatar
I am most sorry for using improper English in >A blawg< deary me.
Posted 10-19-2010 at 12:16 PM by STM

 






 
 
- Oddworld Forums - -