Friend classes

Page 1 of 2 1, 2  Next

View previous topic View next topic Go down

Friend classes

Post  Admin on Tue Dec 07, 2010 12:53 pm

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

Admin
Admin

Posts: 279
Join date: 2010-10-19

View user profile http://eternalquest.forum-phpbb.co.uk

Back to top Go down

Re: Friend classes

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

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

Admin
Admin

Posts: 279
Join date: 2010-10-19

View user profile http://eternalquest.forum-phpbb.co.uk

Back to top Go down

Re: Friend classes

Post  eatcomics on Thu Dec 09, 2010 9: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

eatcomics
God

Posts: 153
Join date: 2010-10-22

View user profile

Back to top Go down

Re: Friend classes

Post  Admin on Fri Dec 10, 2010 3:56 pm

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

Admin
Admin

Posts: 279
Join date: 2010-10-19

View user profile http://eternalquest.forum-phpbb.co.uk

Back to top Go down

Re: Friend classes

Post  WSPSNIPER on Fri Dec 10, 2010 4:28 pm

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

WSPSNIPER
Admin

Posts: 149
Join date: 2010-10-19
Age: 18
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 7: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?

Admin
Admin

Posts: 279
Join date: 2010-10-19

View user profile http://eternalquest.forum-phpbb.co.uk

Back to top Go down

Re: Friend classes

Post  dandymcgee on Fri Dec 10, 2010 8: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 10: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

WSPSNIPER
Admin

Posts: 149
Join date: 2010-10-19
Age: 18
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 1:18 am

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

eatcomics
God

Posts: 153
Join date: 2010-10-22

View user profile

Back to top Go down

Re: Friend classes

Post  WSPSNIPER on Sat Dec 11, 2010 2:14 am

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!

WSPSNIPER
Admin

Posts: 149
Join date: 2010-10-19
Age: 18
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 6:40 pm

Component systems are awesome just because of their flexability Smile

Admin
Admin

Posts: 279
Join date: 2010-10-19

View user profile http://eternalquest.forum-phpbb.co.uk

Back to top Go down

Re: Friend classes

Post  WSPSNIPER on Sat Dec 11, 2010 10: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

WSPSNIPER
Admin

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

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

Back to top Go down

Re: Friend classes

Post  eatcomics on Sun Dec 12, 2010 4:55 am

Can you link me to anything good ya find?

eatcomics
God

Posts: 153
Join date: 2010-10-22

View user profile

Back to top Go down

Re: Friend classes

Post  Admin on Mon Dec 13, 2010 4:57 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.


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

Admin
Admin

Posts: 279
Join date: 2010-10-19

View user profile http://eternalquest.forum-phpbb.co.uk

Back to top Go down

Re: Friend classes

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

HAHAHAHAHA admin fail Razz

eatcomics
God

Posts: 153
Join date: 2010-10-22

View user profile

Back to top Go down

Page 1 of 2 1, 2  Next

View previous topic View next topic Back to top

- Similar topics

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