Friend classes
4 posters
Page 1 of 1
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?
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-21
Re: Friend classes
Loleatcomics 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
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
Re: Friend classes
Admin wrote:Loleatcomics 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
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
Re: Friend classes
Lol, "yet"WSPSNIPER wrote:Admin wrote:Loleatcomics 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
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
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?
Re: Friend classes
What!?!??! Did you seriously just say that?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
Lol.
dandymcgee- New comer
- Posts : 5
Join date : 2010-10-19
Re: Friend classes
dandymcgee wrote:What!?!??! Did you seriously just say that?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
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
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-21
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!
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
Re: Friend classes
Can you link me to anything good ya find?
eatcomics- God
- Posts : 153
Join date : 2010-10-21
Re: Friend classes
dandymcgee wrote:What!?!??! Did you seriously just say that?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
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
Re: Friend classes
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
Re: Friend classes
secondedWSPSNIPER 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
eatcomics- God
- Posts : 153
Join date : 2010-10-21
Re: Friend classes
eatcomics wrote:secondedWSPSNIPER 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
actually i have the most free time when im at school lol xD
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|