Version 6.10 update?

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User_Russian
Addict
Addict
Posts: 1516
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Version 6.10 update?

Post 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.
User avatar
the.weavster
Addict
Addict
Posts: 1576
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: Version 6.10 update?

Post 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.
User avatar
mk-soft
Always Here
Always Here
Posts: 6201
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Version 6.10 update?

Post 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. :mrgreen:
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User_Russian
Addict
Addict
Posts: 1516
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Version 6.10 update?

Post 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.
User avatar
mk-soft
Always Here
Always Here
Posts: 6201
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Version 6.10 update?

Post by mk-soft »

My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User_Russian
Addict
Addict
Posts: 1516
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Version 6.10 update?

Post 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
User avatar
mk-soft
Always Here
Always Here
Posts: 6201
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Version 6.10 update?

Post by mk-soft »

User_Russian wrote: Fri Dec 01, 2023 8:51 pm 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
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
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply