Posted: Sat Mar 26, 2005 3:12 pm
I am just learning C++. In 18 days (I'm reading Teach Yourself C++ in 21 Days, I'm on #4) I think I might attempt to learn SDL.
JS Lemming, why do you use that style? Isn't it just more typing? I honestly don't see a reason to do that is you could achieve the same thing without the {}'s.
I would write as:
I dunno, I guess it's just a matter of person taste. According to Jesse Liberty, the best way to start a religious war is to ask two programmers the best style to program with.
The dude in the book I'm reading programs kinda like you, JS Lemming. lol
JS Lemming, why do you use that style? Isn't it just more typing? I honestly don't see a reason to do that is you could achieve the same thing without the {}'s.
Code: Select all
void SetLife(int value)
{
life = value;
if(life > maxlife) { life = maxlife; }
}
Code: Select all
void setLife(int value) {
life = value;
if (life>maxlife)
life = maxlife;
}
The dude in the book I'm reading programs kinda like you, JS Lemming. lol