Friend classes

Go down

Friend classes

Post  Admin on Tue Dec 07, 2010 5:53 am

Out of complete curiosity. Who here uses friend classes? I use them a fair bit I know they erase the purpose of OOP but say you have a singelton class with manages a items wouldn't it be easier for it to just access the item components data directly rather than calling set/get shit for example

Code:

// Loading data for items the OOP way
std::ifstream file("Datafile")
std::string name;
file >> name;
Items.SetName(name);
int width = 0;
file >> width;
Items.SetWidth(width);
int height = 0;
file >> height;
Items.SetHeight(height);
std::string triggerscript;
file >> triggerscript;
Items.SetName(triggerscript);

Code:

// The pretty C way!
std::ifstream file("Datafile")
file >> Items.name;
file >> Items.width;
file >> Items.height;
file >> Items.triggerscript;

Am I just lazy?

EDIT: Also whilst introducing the overhead allocating data AND copying it and THEN copying it again is bound to be slower? Suspect
avatar
Admin
Admin

Posts : 279
Join date : 2010-10-19

View user profile http://eternalquest.forumotion.com

Back to top Go down

Re: Friend classes

Post  Admin on Thu Dec 09, 2010 1:19 pm

ROFL, I guess every is just disgusted at me even making this topic lol!
avatar
Admin
Admin

Posts : 279
Join date : 2010-10-19

View user profile http://eternalquest.forumotion.com

Back to top Go down

Re: Friend classes

Post  eatcomics on Thu Dec 09, 2010 2:38 pm

I am extremely disgusted. OOP was invented to save your sanity, it is a Jesus of programming, how could you go against OOP like that... WE SHOULD BURN YOU AT THE STAKE FOR GOING AGAINST OOP

in all seriousness, fuck OOP, code how you want, this isn't professional grade software xD
avatar
eatcomics
God

Posts : 153
Join date : 2010-10-21

View user profile

Back to top Go down

Re: Friend classes

Post  Admin on Fri Dec 10, 2010 8:56 am

eatcomics wrote:I am extremely disgusted. OOP was invented to save your sanity, it is a Jesus of programming, how could you go against OOP like that... WE SHOULD BURN YOU AT THE STAKE FOR GOING AGAINST OOP

in all seriousness, fuck OOP, code how you want, this isn't professional grade software xD
Lol

To be honest who actully gives a fuck? As long as the software does "what it should" then its a success right?

Not many people realize how slow OOP can get.
I only dare say this because its in a private forum Wink
avatar
Admin
Admin

Posts : 279
Join date : 2010-10-19

View user profile http://eternalquest.forumotion.com

Back to top Go down

Re: Friend classes

Post  WSPSNIPER on Fri Dec 10, 2010 9:28 am

Admin wrote:
eatcomics wrote:I am extremely disgusted. OOP was invented to save your sanity, it is a Jesus of programming, how could you go against OOP like that... WE SHOULD BURN YOU AT THE STAKE FOR GOING AGAINST OOP

in all seriousness, fuck OOP, code how you want, this isn't professional grade software xD
Lol

To be honest who actully gives a fuck? As long as the software does "what it should" then its a success right?

Not many people realize how slow OOP can get.
I only dare say this because its in a private forum Wink

i agree, i dont think any of our followers would care ( yet ) but ya lol
avatar
WSPSNIPER
Admin

Posts : 149
Join date : 2010-10-19
Age : 24
Location : MN

View user profile http://www.theeternalquest.comze.com

Back to top Go down

Re: Friend classes

Post  Admin on Fri Dec 10, 2010 12:26 pm

WSPSNIPER wrote:
Admin wrote:
eatcomics wrote:I am extremely disgusted. OOP was invented to save your sanity, it is a Jesus of programming, how could you go against OOP like that... WE SHOULD BURN YOU AT THE STAKE FOR GOING AGAINST OOP

in all seriousness, fuck OOP, code how you want, this isn't professional grade software xD
Lol

To be honest who actully gives a fuck? As long as the software does "what it should" then its a success right?

Not many people realize how slow OOP can get.
I only dare say this because its in a private forum Wink

i agree, i dont think any of our followers would care ( yet ) but ya lol
Lol, "yet"

I admit I approach things with a C-style manor too much but when somthing will

1- Take less time
2- Do the job just the same
3- EVEN run better

Why fuck should this be a issue?
avatar
Admin
Admin

Posts : 279
Join date : 2010-10-19

View user profile http://eternalquest.forumotion.com

Back to top Go down

Re: Friend classes

Post  dandymcgee on Fri Dec 10, 2010 1:31 pm

Admin wrote:
To be honest who actully gives a fuck? As long as the software does "what it should" then its a success right?

Not many people realize how slow OOP can get.
I only dare say this because its in a private forum Wink
What!?!??! Did you seriously just say that? Shocked

Lol.

dandymcgee
New comer

Posts : 5
Join date : 2010-10-19

View user profile

Back to top Go down

Re: Friend classes

Post  WSPSNIPER on Fri Dec 10, 2010 3:07 pm

dandymcgee wrote:
Admin wrote:
To be honest who actully gives a fuck? As long as the software does "what it should" then its a success right?

Not many people realize how slow OOP can get.
I only dare say this because its in a private forum Wink
What!?!??! Did you seriously just say that? Shocked

Lol.

i agree, sometimes having an oop approach will be better even if your points may be correct because of organization and being able to see it in a real life situation + the ability to change it fairly quickly with out much hassle on changing code all over the place. but i do agree that some people do put too much emphasis on oop... whatev as long as it gets the job done right Very Happy
avatar
WSPSNIPER
Admin

Posts : 149
Join date : 2010-10-19
Age : 24
Location : MN

View user profile http://www.theeternalquest.comze.com

Back to top Go down

Re: Friend classes

Post  eatcomics on Fri Dec 10, 2010 6:18 pm

I'm thinking component based for my next one, some OOP but not a whole lot Very Happy
avatar
eatcomics
God

Posts : 153
Join date : 2010-10-21

View user profile

Back to top Go down

Re: Friend classes

Post  WSPSNIPER on Fri Dec 10, 2010 7:14 pm

eatcomics wrote:I'm thinking component based for my next one, some OOP but not a whole lot Very Happy

i did a componet based sys and loved it!
avatar
WSPSNIPER
Admin

Posts : 149
Join date : 2010-10-19
Age : 24
Location : MN

View user profile http://www.theeternalquest.comze.com

Back to top Go down

Re: Friend classes

Post  Admin on Sat Dec 11, 2010 11:40 am

Component systems are awesome just because of their flexability Smile
avatar
Admin
Admin

Posts : 279
Join date : 2010-10-19

View user profile http://eternalquest.forumotion.com

Back to top Go down

Re: Friend classes

Post  WSPSNIPER on Sat Dec 11, 2010 3:46 pm

im going to make another component system but im going to do some research on different implementations of it first so i can make a super nice one
avatar
WSPSNIPER
Admin

Posts : 149
Join date : 2010-10-19
Age : 24
Location : MN

View user profile http://www.theeternalquest.comze.com

Back to top Go down

Re: Friend classes

Post  eatcomics on Sat Dec 11, 2010 9:55 pm

Can you link me to anything good ya find?
avatar
eatcomics
God

Posts : 153
Join date : 2010-10-21

View user profile

Back to top Go down

Re: Friend classes

Post  Admin on Mon Dec 13, 2010 9:57 am

dandymcgee wrote:
Admin wrote:
To be honest who actully gives a fuck? As long as the software does "what it should" then its a success right?

Not many people realize how slow OOP can get.
I only dare say this because its in a private forum Wink
What!?!??! Did you seriously just say that? Shocked

Lol.

HOLY FUCK THIS ISN'T THE PRIVATE FORUMS!!?!?!?!

Er.... What I meant to say was, I love OOP damn those C-styled hardcodes don't know what they're missing Wink
avatar
Admin
Admin

Posts : 279
Join date : 2010-10-19

View user profile http://eternalquest.forumotion.com

Back to top Go down

Re: Friend classes

Post  eatcomics on Mon Dec 13, 2010 1:48 pm

HAHAHAHAHA admin fail Razz
avatar
eatcomics
God

Posts : 153
Join date : 2010-10-21

View user profile

Back to top Go down

Re: Friend classes

Post  Admin on Tue Dec 14, 2010 3:44 am

eatcomics wrote:HAHAHAHAHA admin fail Razz
Yip, I fucked up there.
avatar
Admin
Admin

Posts : 279
Join date : 2010-10-19

View user profile http://eternalquest.forumotion.com

Back to top Go down

Re: Friend classes

Post  WSPSNIPER on Tue Dec 14, 2010 9:39 am

eatcomics wrote:HAHAHAHAHA admin fail Razz

LMAO
avatar
WSPSNIPER
Admin

Posts : 149
Join date : 2010-10-19
Age : 24
Location : MN

View user profile http://www.theeternalquest.comze.com

Back to top Go down

Re: Friend classes

Post  Admin on Sun Dec 19, 2010 10:56 am

The forum was dead before, now even team members are using it rarely. Hmm......
avatar
Admin
Admin

Posts : 279
Join date : 2010-10-19

View user profile http://eternalquest.forumotion.com

Back to top Go down

Re: Friend classes

Post  WSPSNIPER on Mon Dec 20, 2010 8:00 am

Admin wrote:The forum was dead before, now even team members are using it rarely. Hmm......

i think over winter break we will be able to get more done but school and work are taking all of my time right now Razz
avatar
WSPSNIPER
Admin

Posts : 149
Join date : 2010-10-19
Age : 24
Location : MN

View user profile http://www.theeternalquest.comze.com

Back to top Go down

Re: Friend classes

Post  eatcomics on Mon Dec 20, 2010 5:20 pm

WSPSNIPER wrote:
Admin wrote:The forum was dead before, now even team members are using it rarely. Hmm......

i think over winter break we will be able to get more done but school and work are taking all of my time right now Razz
seconded
avatar
eatcomics
God

Posts : 153
Join date : 2010-10-21

View user profile

Back to top Go down

Re: Friend classes

Post  WSPSNIPER on Tue Dec 21, 2010 7:29 am

eatcomics wrote:
WSPSNIPER wrote:
Admin wrote:The forum was dead before, now even team members are using it rarely. Hmm......

i think over winter break we will be able to get more done but school and work are taking all of my time right now Razz
seconded

actually i have the most free time when im at school lol xD
avatar
WSPSNIPER
Admin

Posts : 149
Join date : 2010-10-19
Age : 24
Location : MN

View user profile http://www.theeternalquest.comze.com

Back to top Go down

Re: Friend classes

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum