Hello everyone,
I would like to have your opinion about use of public objects rather than public functions;
maybe it is a scholarly disquisition and difficult (for me) to be addressed in English, so I will use a practical example.
My executable is composed of various sources and I use a public array to store information (for example, the
font name to use in forms); through a public function, I access this array to store or retrieve this information in any source.
Alternatively, I could use a public object (class), which contains an array and function to store or retrieve information.
Basically does not change much more, but I want to understand which of the two methods could be considered more efficient ore less expensive
I hope the explanation and question are clear.
Best regards
public object or public function
Moderator: Rathinagiri
public object or public function
Luigi from Italy
www.L3W.it
www.L3W.it
- Rathinagiri
- Posts: 5482
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: public object or public function
IMHO, both of them are preferable.
It is the situation that warranties which one we choose. If you re-use the code again and again many times that too by changing one or two array items from the default then and there, then object is preferable since you can just inherit the object and do the changes easily.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: public object or public function
Hi Rathinagiri,
many thanks for your opinion. I'll try my POW about object with a little project and then I share it on this forum.
Bye
many thanks for your opinion. I'll try my POW about object with a little project and then I share it on this forum.
Bye
Luigi from Italy
www.L3W.it
www.L3W.it