OOP tutorial added to the nxSoftware site!
OOP tutorial added to the nxSoftware site!
Hi,
just thought I'd let you know that I have just added the first tutorial to the nxSoftware site (in the form of a downloadable zip file).
This one kind of came at me by request and it interested me enough to cobble together a few words lacking in any kind of wisdom!
The tutorial aims to show how to use simple OOP techniques using nothing but native Purebasic code (i.e. no pre-processors etc.) It doesn't try to discuss general OOP techniques or program design or convince anyone that they should be using OOP above all other paradigms etc. It is simply intended to show how to implement a basic class in Purebasic etc.
This interested me because I now use OOP in all of my Purebasic programs; finding that PB's simplicity and clarity means that it's basic OOP is, for me at least, very effective and a boon for maintaining my code!
For those who use some of my OOP utilities and have studied the code therein, there will be no need at all to look at the tutorial as there will be nothing new in there for you. Ditto for those who have already used OOP in PB for themselves.
I hope it is useful in some way, but apologise in advance if it turns out to be a pile of unlaundered pants!
Regards.
Stephen.
just thought I'd let you know that I have just added the first tutorial to the nxSoftware site (in the form of a downloadable zip file).
This one kind of came at me by request and it interested me enough to cobble together a few words lacking in any kind of wisdom!
The tutorial aims to show how to use simple OOP techniques using nothing but native Purebasic code (i.e. no pre-processors etc.) It doesn't try to discuss general OOP techniques or program design or convince anyone that they should be using OOP above all other paradigms etc. It is simply intended to show how to implement a basic class in Purebasic etc.
This interested me because I now use OOP in all of my Purebasic programs; finding that PB's simplicity and clarity means that it's basic OOP is, for me at least, very effective and a boon for maintaining my code!
For those who use some of my OOP utilities and have studied the code therein, there will be no need at all to look at the tutorial as there will be nothing new in there for you. Ditto for those who have already used OOP in PB for themselves.
I hope it is useful in some way, but apologise in advance if it turns out to be a pile of unlaundered pants!
Regards.
Stephen.
I may look like a mule, but I'm not a complete ass.
Re: OOP tutorial added to the nxSoftware site!
I do too, and it has boosted my productivity ten times over. Thanks for the tutorial -- interesting stuffsrod wrote:This interested me because I now use OOP in all of my Purebasic programs
Re: OOP tutorial added to the nxSoftware site!
Aye, I would claim a similar boost in productivity simply because OOP forces me to think in far more depth about my program's design etc. Gone are the days of leaping head first into an application only to code myself around the equivalent of a u-bend to then have fangbeast come along and flush the toilet!eesau wrote:I do too, and it has boosted my productivity ten times over. Thanks for the tutorial -- interesting stuffsrod wrote:This interested me because I now use OOP in all of my Purebasic programs
In a strange way I am glad that PB has not gone down the OOP path because with things the way they are it is just all so simple and, dare I say it, logical!
I may look like a mule, but I'm not a complete ass.
- netmaestro
- PureBasic Bullfrog
- Posts: 8433
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
- flaith
- Enthusiast
- Posts: 704
- Joined: Mon Apr 25, 2005 9:28 pm
- Location: $300:20 58 FC 60 - Rennes
- Contact:
thanks a lot srod
**edit*** inside rectangleclass.pbi, the last line :
change to
**edit*** inside rectangleclass.pbi, the last line :
Code: Select all
;-VIRTUAL TABLES.
DataSection
VTable_RectangleClass:
Data.i @RectangleClass_Area()
Data.i @RectangleClass_Destroy()
Data.i @RectangleClass_GetLength()
Data.i @RectangleClass_GetWidth()
Data.i @RectangleClass_IsSquare()
Data.i @RectangleClass_LengthOfDiagonal()
Data.i @RectangleClass_SetLength()
Data.i @RectangleClass_SetLength()
EndDataSection
Code: Select all
;-VIRTUAL TABLES.
DataSection
VTable_RectangleClass:
Data.i @RectangleClass_Area()
Data.i @RectangleClass_Destroy()
Data.i @RectangleClass_GetLength()
Data.i @RectangleClass_GetWidth()
Data.i @RectangleClass_IsSquare()
Data.i @RectangleClass_LengthOfDiagonal()
Data.i @RectangleClass_SetLength()
Data.i @RectangleClass_SetWidth()
EndDataSection
“Fear is a reaction. Courage is a decision.” - WC
- Fangbeast
- PureBasic Protozoa
- Posts: 4749
- Joined: Fri Apr 25, 2003 3:08 pm
- Location: Not Sydney!!! (Bad water, no goats)
Re: OOP tutorial added to the nxSoftware site!
I would flush it but your head is still stuck firmly down the s-bend!!! Were you fishing for you steaming g-strings again???Gone are the days of leaping head first into an application only to code myself around the equivalent of a u-bend to then have fangbeast come along and flush the toilet!
Amateur Radio, D-STAR/VK3HAF
So a Pure Object Oriented Program would be called "POOP"!
Russell
Russell
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***