Friend classes
Page 1 of 2 • Share •
Page 1 of 2 • 1, 2 
Friend classes
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
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?
- 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?

Admin- Admin
- Posts: 279
Join date: 2010-10-19

Re: Friend classes
ROFL, I guess every is just disgusted at me even making this topic

Admin- Admin
- Posts: 279
Join date: 2010-10-19

Re: Friend classes
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
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
Re: Friend classes
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

Admin- Admin
- Posts: 279
Join date: 2010-10-19

Re: Friend classes
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![]()
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

Re: Friend classes
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![]()
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

Re: Friend classes
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![]()
What!?!??! Did you seriously just say that?
Lol.
dandymcgee- New comer
- Posts: 5
Join date: 2010-10-19
Re: Friend classes
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![]()
What!?!??! Did you seriously just say that?![]()
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

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

Re: Friend classes
I'm thinking component based for my next one, some OOP but not a whole lot 

eatcomics- God
- Posts: 153
Join date: 2010-10-22
Re: Friend classes
eatcomics wrote:I'm thinking component based for my next one, some OOP but not a whole lot
i did a componet based sys and loved it!

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

Re: Friend classes
Component systems are awesome just because of their flexability 

Admin- Admin
- Posts: 279
Join date: 2010-10-19

Re: Friend classes
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

Re: Friend classes
Can you link me to anything good ya find?

eatcomics- God
- Posts: 153
Join date: 2010-10-22
Re: Friend classes
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![]()
What!?!??! Did you seriously just say that?![]()
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

Admin- Admin
- Posts: 279
Join date: 2010-10-19

Page 1 of 2 • 1, 2 
Similar topics» My friend...
» Utilização das Classes
» More and better/fair mob arena classes
» My friend Alatyr.. Sad day for syltice
» New server, new files, new classes, new everything,
» Utilização das Classes
» More and better/fair mob arena classes
» My friend Alatyr.. Sad day for syltice
» New server, new files, new classes, new everything,
Page 1 of 2
Permissions in this forum:
You cannot reply to topics in this forum