There is a project written in PHP that is just simply all procedural … step by step calling DB functions, processing, and printing out the output. And then it is changed to totally object oriented — there is a singleton for the App object, and various functions are invoked through the App object.
Someone claims that the memory usage or footprint on the server will be less. Would that be the case? I thought procedural often just uses the bare minimal, while Object oriented programming with various design patterns usually instantiates more things than needed, or simply have objects around while procedural usually just have the bare minimal.
So will changing all code to object oriented actually make the memory usage on the server smaller?
It will probably make it more, but there’s really no way to tell. If your code actually improves by doing it in an OOP way, then it may be less. There is no direct correlation between memory used and the presence of object oriented ness. Maybe in general, object oriented takes more memory, but only if both sets of code are written equally well, and that’s almost never the case.
Is there a reason this application is being upgraded to be objected oriented? You know it’s not one or the other, you can mix and match pieces… OOP is not a silver bullet.