Page 3 of 3
Re: Version 6.10 update?
Posted: Fri Dec 01, 2023 12:13 pm
by User_Russian
The module is not OOP.
A module can be compared to a static class, but it is not a fully functional analogue.
Re: Version 6.10 update?
Posted: Fri Dec 01, 2023 5:37 pm
by the.weavster
User_Russian wrote: Fri Dec 01, 2023 12:13 pm
The module is not OOP.
Correct. PB nicely separates data from behaviour.
But it's not like the two paradigms are so far from each other that you have to totally change your thinking.
Re: Version 6.10 update?
Posted: Fri Dec 01, 2023 8:05 pm
by mk-soft
Even though I sometimes use OOP, I don't really want it as a base in PB. But sometimes it would be nice to have some helper functions to fill in the virtual methods to support external OOP.
OOP is a memory-hungry and performance-hungry method to force users to buy faster and bigger computers.

Re: Version 6.10 update?
Posted: Fri Dec 01, 2023 8:12 pm
by User_Russian
The simplest implementation of OOP - procedures in structures and the presence of a constructor and destructor, does not require a large amount of memory and a powerful processor.
In some cases OOP allows a program to be written more efficiently.
Re: Version 6.10 update?
Posted: Fri Dec 01, 2023 8:24 pm
by mk-soft
Re: Version 6.10 update?
Posted: Fri Dec 01, 2023 8:51 pm
by User_Russian
Does this module implement an
automatically called constructor and destructor?
For example, when we create a local instance of a structures, string, array, or list in a procedure, we do not need to worry about initializing and deinitializing them.
In the same way, a constructor and destructor should be automatically called for an object.
I suggested this for structures.
https://www.purebasic.fr/english/viewtopic.php?t=71572
Procedures in structures
https://www.purebasic.fr/english/viewtopic.php?t=45156
Re: Version 6.10 update?
Posted: Fri Dec 01, 2023 9:09 pm
by mk-soft
Yes, you only have to assign a Procdure as Constructor (AsInitalizeObject) and a Procedure as Destructor (AsDisposeObject).
These are also called automatically in the correct order in the case of inheritance or multiple inheritance.
Desciption of Module BassClass