[solved] virtual functions or function pointers?

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: which is faster, virtual functions or function pointers?

Post by dandymcgee »

N64vSNES wrote:But if you're going to write absolutely ANYTHING in C++ then irrelevant of the overhead produced (in my opinion) you should take full advantage of Object Oriented Programming.
See the word you capitalized there? Whether intentionally or not you were referring to EVERY SINGLE CASE EVER, not just the question in this thread.

I think you could have avoided a lot of shit if you were a bit more specific in your post.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
XianForce
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 767
Joined: Wed Oct 29, 2008 8:36 pm

Re: which is faster, virtual functions or function pointers?

Post by XianForce »

N64vSNES wrote:But if you're going to write absolutely ANYTHING in C++ then irrelevant of the overhead produced (in my opinion) you should take full advantage of Object Oriented Programming.
Too much testosterone on these boards, me thinks XD.

But in all honesty, man, your on these boards, so you probably think the ES team has some great skill and talent in this area. And if that is true, why do you take such an aggressive stance on your opinion? I had the first comment in this thread, and I was passive about it, I spoke what I thought, but left it open for someone to say I was wrong. You've made yourself a reputation of sorts on these boards, so perhaps you should start toning your opinion down a bit. Although you did state that it was your opinion, it still can be misleading to newbies who come, because they may not be sure of who's advice to follow. Falco may be a little pushy when it comes to debating stuff like this, but in the end, it would appear that he has real honest and good intentions. He doesn't want the newbies that come to his board to be pushed in the wrong direction... I know that with all the arguments Falco has refuted, I've learned a lot. Not only does he provide reasons for why his implementation works, he provides reasons for why other methods don't. So I think Falco provides a great learning environment here, and I think you sometimes cloud it... Just saying...
N64vSNES
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 632
Joined: Thu Aug 12, 2010 11:25 am

Re: which is faster, virtual functions or function pointers?

Post by N64vSNES »

XianForce wrote:
N64vSNES wrote:But if you're going to write absolutely ANYTHING in C++ then irrelevant of the overhead produced (in my opinion) you should take full advantage of Object Oriented Programming.
Too much testosterone on these boards, me thinks XD.

But in all honesty, man, your on these boards, so you probably think the ES team has some great skill and talent in this area. And if that is true, why do you take such an aggressive stance on your opinion? I had the first comment in this thread, and I was passive about it, I spoke what I thought, but left it open for someone to say I was wrong. You've made yourself a reputation of sorts on these boards, so perhaps you should start toning your opinion down a bit. Although you did state that it was your opinion, it still can be misleading to newbies who come, because they may not be sure of who's advice to follow. Falco may be a little pushy when it comes to debating stuff like this, but in the end, it would appear that he has real honest and good intentions. He doesn't want the newbies that come to his board to be pushed in the wrong direction... I know that with all the arguments Falco has refuted, I've learned a lot. Not only does he provide reasons for why his implementation works, he provides reasons for why other methods don't. So I think Falco provides a great learning environment here, and I think you sometimes cloud it... Just saying...
I admit a few arguments in the past I've taken too far. This perticular time has really pissed me off because he's going back on his own words purely to start an argument. Irrelevant of Falco's experiance notice how he "Tells" people the way to go and bitches at me for giving an "opinion" of the way to go.

If you don't find my approach apropiate instead of
"Stop talking shit, I'm right, you're wrong"
What's wrong with
"Thats one way to go but I belive a better way would be..."

Back to my original post I said "ANYTHING" as in if you are writing anything in C++ then use the C++ pretty way.

I can understand where people is coming from and I can understand how you mis-read my post but I wasn't saying "Abuse the fuck out of OO"
I was saying
"If you are to use C++ then if the is a better OO alternative then use that alternative"
In this perticular case a virtual function is a much prettier way to go than a ugly ass function pointer. Function pointers syntax are a mindfuck.
User avatar
adikid89
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 94
Joined: Tue Apr 27, 2010 6:59 am
Current Project: small tiny-mini projects
Favorite Gaming Platforms: PC I guess...
Programming Language of Choice: c++

Re: [solved] virtual functions or function pointers?

Post by adikid89 »

N64vSNES wrote:Function pointers syntax are a mindfuck.
you can typedef it away... still.. there are times when virtual functions are a better solution, and times when a function pointer is all you need.
My first game C++/SDL Yoshi Combat! = http://www.youtube.com/watch?v=HQ9mMBEWSZg
==============================================================
Image
XianForce
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 767
Joined: Wed Oct 29, 2008 8:36 pm

Re: which is faster, virtual functions or function pointers?

Post by XianForce »

N64vSNES wrote: "If you are to use C++ then if the is a better OO alternative then use that alternative"
Not going to lie, that is one of the most confusing sentences I have ever read. I can really see how people misinterpret what you mean, because your sentence structure is... To be frank... Not appealing in any sense :o.

But, I do understand where you're coming from... But in my mind, these boards belong to Falco... He pays the money so that we have this community to come and get help... I think he has the authority to complain about whatever he wishes. But, the problem is, neither of you offers a passive post. You referenced that he should post in a passive fashion:
If you don't find my approach apropiate instead of
"Stop talking shit, I'm right, you're wrong"
What's wrong with
"Thats one way to go but I belive a better way would be..."
But you don't seem willing to do the same :/... Just saying...
User avatar
koolgraph
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 18
Joined: Thu Feb 17, 2011 1:49 am
Current Project: A-RPG (MMO ?) Engine
Favorite Gaming Platforms: SNES, GameBoy, PS3, PC
Programming Language of Choice: C++/#

Re: which is faster, virtual functions or function pointers?

Post by koolgraph »

Lol sorry, i know it's a month old topic but that was just too awesome to be ignored XD
GyroVorbis wrote:You think that I'm a dick for calling you on your bullshit? I'm fucking Batman here. Somebody has to be the dark knight for the greater good. Hate me all you want, but at least Gotham is safe, bitch. ;)
Post Reply