Page 2 of 2

Re: Should STL be used in game programming

Posted: Mon Jun 22, 2009 1:40 pm
by MarauderIIC
Rolling your own, by the way, decreases that overhead. Even if you use templates, too.

I think.

Re: Should STL be used in game programming

Posted: Mon Jun 22, 2009 2:46 pm
by Netwatcher
Interesting, if ur going to "roll your own" I really want to see this.

To Marauder:
Stop saying "I think", it makes your claim uncertain.
If u haven't thought about that you wouldn't have written it!
and if you're wrong someone will correct you anyway.

Re: Should STL be used in game programming

Posted: Mon Jun 22, 2009 3:17 pm
by programmerinprogress
Netwatcher wrote:Interesting, if ur going to "roll your own" I really want to see this.
To Marauder:
Stop saying "I think", it makes your claim uncertain.
.
He's not sure, but he's pretty certain from his experience, so he's saying "I think" because he's trying not to be a know-it-all who might have his facts wrong, so cut the man some slack ;)

As for "rolling your own", logically you could make your own templates with a much lower overhead, as you would only implement the methods which you know you're going to use, therefore the size of the template, and it's footprint would decrease (but this of course depends on the number of methods, and how they're implemented of course, you could end up adding MORE, if you could think of any!)

also, making your own container templates isn't exactly "out there", it can be done, you just need to get your head around dynamic memory and data structures, i'm not saying I could implement one right now, but it's plausible with a little bit of research...

I think :lol:

Re: Should STL be used in game programming

Posted: Mon Jun 22, 2009 3:24 pm
by Netwatcher
programmerinprogress wrote:
Netwatcher wrote:Interesting, if ur going to "roll your own" I really want to see this.
To Marauder:
Stop saying "I think", it makes your claim uncertain.
.
He's not sure, but he's pretty certain from his experience, so he's saying "I think" because he's trying not to be a know-it-all who might have his facts wrong, so cut the man some slack ;)

As for "rolling your own", logically you could make your own templates with a much lower overhead, as you would only implement the methods which you know you're going to use, therefore the size of the template, and it's footprint would decrease (but this of course depends on the number of methods, and how they're implemented of course, you could end up adding MORE, if you could think of any!)

also, making your own container templates isn't exactly "out there", it can be done, you just need to get your head around dynamic memory and data structures, i'm not saying I could implement one right now, but it's plausible with a little bit of research...

I think :lol:
I agree,it's going to increase deving time by a hell lot :nono:.

Edit: The following line was Deleted by the author due to temporal stupidity :roll:...

Re: Should STL be used in game programming

Posted: Mon Jun 22, 2009 3:37 pm
by Innerscope
I agree,it's going to increase deving time by a hell lot :nono:.
You should be writing you're own templates though, it's a lot better than writing multiple classes that use the same implementation or including STL. So I wouldn't consider it a bad thing.

Re: Should STL be used in game programming

Posted: Mon Jun 22, 2009 3:41 pm
by Netwatcher
Innerscope wrote:
I agree,it's going to increase deving time by a hell lot :nono:.
You should be writing you're own templates though, it's a lot better than writing multiple classes that use the same implementation or including STL. So I wouldn't consider it a bad thing.
I actually (and I bet everyone does) like writing my own stuff.
I also have no idea how to write templates(that and AI).
So I write one huge class instead of a little template.
there's much for me to learn, grasshopper.

Re: Should STL be used in game programming

Posted: Mon Jun 22, 2009 4:15 pm
by Ginto8
Netwatcher wrote:I also have no idea how to write templates.

Code: Select all

template <typename T>
class myTemplate {
    T myTemplateVar;
public:
template<typename T2>
    T2 myTemplateFunctionInsideTemplateClass(T param); // lol long function name
    T myNormalFunctionInsideTemplateClass(); // lol another long function name
};

T2 myTemplateFunctionInsideTemplateClass(T param)
{
    return (T2)param;
}

T myNormalFunctionInsideTemplateClass()
{
    return myTemplateVar;
}
remember to define the functions of the class inside the same header as the class declaration. This is because template classes aren't compiled until an instance of them is used. Don't worry, your compiler should be smart enough to combine/compress template definitions of the same typename and definitions together (a template class Moose and a template class Cow wouldn't get combined).

Re: Should STL be used in game programming

Posted: Mon Jun 22, 2009 4:35 pm
by MarauderIIC
programmerinprogress wrote:
Netwatcher wrote:To Marauder:
Stop saying "I think", it makes your claim uncertain.
He's not sure, but he's pretty certain from his experience, so he's saying "I think" because he's trying not to be a know-it-all who might have his facts wrong, so cut the man some slack ;)
Correct.
Netwatcher wrote:nobody will kill u if ur wrong
Saying "I think" changes the tone of the response, and also invites others to correct me or back me up. It also keeps me from looking like an idiot. Further, not saying "I think" or equivalent when I am unsure opens the possibility of presenting incorrect facts that inexperienced users -- who don't know that what I've stated is wrong -- will take at face value without verification, producing bad habits and decreasing their value to later employers.
Netwatcher wrote:I also think that Marauder is just experienced enough, and even when u say something ur not sure about you need to say it at the tops of your lungs, :roll:...
Thanks for the vote of confidence :)

Rolling my own template classes is not something I've needed to do on a large scale, yet, hence, I was unsure.

Re: Should STL be used in game programming

Posted: Mon Jun 22, 2009 4:50 pm
by zodiac976
Netwatcher wrote:
Innerscope wrote:
I agree,it's going to increase deving time by a hell lot :nono:.
You should be writing you're own templates though, it's a lot better than writing multiple classes that use the same implementation or including STL. So I wouldn't consider it a bad thing.
I actually (and I bet everyone does) like writing my own stuff.
I also have no idea how to write templates(that and AI).
So I write one huge class instead of a little template.
there's much for me to learn, grasshopper.
I am still learning templates and I have yet to use them but I do
hope I start finding a use for them soon. I usually split my stuff
into multiple classes and use inheritance and friends if needed.

Re: Should STL be used in game programming

Posted: Mon Jun 22, 2009 5:04 pm
by Netwatcher
zodiac976 wrote:
Netwatcher wrote:
Innerscope wrote:
I agree,it's going to increase deving time by a hell lot :nono:.
You should be writing you're own templates though, it's a lot better than writing multiple classes that use the same implementation or including STL. So I wouldn't consider it a bad thing.
I actually (and I bet everyone does) like writing my own stuff.
I also have no idea how to write templates(that and AI).
So I write one huge class instead of a little template.
there's much for me to learn, grasshopper.
I am still learning templates and I have yet to use them but I do
hope I start finding a use for them soon. I usually split my stuff
into multiple classes and use inheritance and friends if needed.
What about creating a struct in an existing class instead of writing a new class(when possible).

Re: Should STL be used in game programming

Posted: Mon Jun 22, 2009 5:14 pm
by zodiac976
Netwatcher wrote:
zodiac976 wrote:
Netwatcher wrote:
Innerscope wrote:
I agree,it's going to increase deving time by a hell lot :nono:.
You should be writing you're own templates though, it's a lot better than writing multiple classes that use the same implementation or including STL. So I wouldn't consider it a bad thing.
I actually (and I bet everyone does) like writing my own stuff.
I also have no idea how to write templates(that and AI).
So I write one huge class instead of a little template.
there's much for me to learn, grasshopper.
I am still learning templates and I have yet to use them but I do
hope I start finding a use for them soon. I usually split my stuff
into multiple classes and use inheritance and friends if needed.
What about creating a struct in an existing class instead of writing a new class(when possible).
Ever since I learned classes I don't see a use for structures but
you never know I may end up eating my words :lol:.

Re: Should STL be used in game programming

Posted: Mon Jun 22, 2009 8:00 pm
by Falco Girgis
Netwatcher wrote:I also think that Marauder is just experienced enough, and even when u say something ur not sure about you need to say it at the tops of your lungs, nobody will kill u if ur wrong :roll:...
I don't think you're ever experienced enough to say something (that you don't know for sure) as fact. That's called being an arrogant douche bag.

Re: Should STL be used in game programming

Posted: Mon Jun 22, 2009 8:32 pm
by Netwatcher
You are partially right.
There's a difference between a personal opinion (i.e. "We're making the best indie game ever") and a professional opinion.

Re: Should STL be used in game programming

Posted: Mon Jun 22, 2009 9:07 pm
by rolland
GyroVorbis wrote:That's called being an arrogant douche bag.
Elegantly put. :)

Re: Should STL be used in game programming

Posted: Tue Jun 23, 2009 12:19 pm
by Falco Girgis
Netwatcher wrote:You are partially right.
There's a difference between a personal opinion (i.e. "We're making the best indie game ever") and a professional opinion.
So what is consistent with the two? Opinion. Neither is confirmed fact, and neither should be advertised or treated as such.