I'm currently working on a project which requires me to only output objects when querying database and/or processing data. I have been hearing from other senior developers that, objects are "cheap" in term of memory and, I "kind of" agree with that.
So, my questions:
- If I have an array as result of a query. Why not use the array "as is" since it already exists?
- Is it really a good practice (besides standardization) to convert it into an object?
- Does it really increase performance? (I can't grasp it because by converting the result into an object, I'm basically creating another entity, besides the already existing array, containing the same data).