Well now I am working on a small project and I wonder about class effectivness in reaching my goal.
The idea is that I have some similar functions but they output different results according to the parameters. The parameter is either all global variables or some array of variables.
The basic idea is:
function1->function2->function3
In function1 we prepare, in function2 we do some more preparation and finaly we call function3 for output. function1 can be skipped, and function2 can be called. in function3 we have to output the variables - either global or the array passed.
The solution for this is to have three regular functions, which pass over all parameters to each other or create objects based on one class everytime i need this sequence. Now I am wondering which of the solutions takes less memory and cpu resources. What if I create thousands of objects? Is it effective if in each object we store all the parameters? Will I save memory if I create a class? Because I'm thinking that when you have an object it just takes memory for it's properties and all functions are saved as a class, while everytime I call a function it allocates it's own memory for every variable?