Easy OOP features
To be honest. Since I coded in Java lately - I start to think in objects
when I code. So, I really miss an easy way to use objects in PureBasic, too.
I totally agree with mp303 on this. Just some basic usage of objects in a
simple way would make PureBasic even better. And noone would be forced
to use objects, if he/she doesnt want to ...
Anyway, it is up to Fred to decide in which direction Purebasic evolves. And
don't get me wrong - I am really happy with the current version of PB
when I code. So, I really miss an easy way to use objects in PureBasic, too.
I totally agree with mp303 on this. Just some basic usage of objects in a
simple way would make PureBasic even better. And noone would be forced
to use objects, if he/she doesnt want to ...
Anyway, it is up to Fred to decide in which direction Purebasic evolves. And
don't get me wrong - I am really happy with the current version of PB

regards,
benny!
-
pe0ple ar3 str4nge!!!
benny!
-
pe0ple ar3 str4nge!!!
hehe. Not for too long, I hope. You have a book to finish and I for one am looking forward to reading it.Kale wrote:... i'm going for a lay down somewhere.

With all the requests for Pure-OOP, I smell opportunity. I am wondering why some crash hot coder doesn't do a really good OOP "pre-processor language" and sell it. If I had the nous, I would. Unfortunately for me, I don't have the nous.
Dare2 cut down to size
-
- Addict
- Posts: 1648
- Joined: Mon Sep 20, 2004 3:52 pm
- Contact:
-
- Addict
- Posts: 1648
- Joined: Mon Sep 20, 2004 3:52 pm
- Contact:
But that's not an argument. We already agree that it isn't - we're discussing wether it could be. I don't understand why this seems to infuriate and frustrate you this badly.Kale wrote:because Purebasic is NOT an OOP language!mp303 wrote:And really, what is your problem? Why are you so dead-set against OOP features in PB? You won't be forced to use them.
If you have any actual arguments against OOP features, I'd like to hear your reasons. So far I haven't heard any.
If your best argument is that OOP is "evil", I think you should take a chair - no one's going to listen to that anyway.
So tell us:
What is so terrible about OOP, that you have to protect other PB users from ever touching it?
How exactly does the addition of OOP features to PB threaten to destroy PB for you and everyone else?
Computers are no more procedural than they are object-oriented, that's all up to the programming language. Have you looked at machine code? See any procedures in there?dracflamloc wrote:Well the world is OO but computers are procedural. Thats why C++ OOP is so inefficient when compared to a well written C app.
If your argument is, that a programming language should be as close to machine language as possible, then in fact, procedures should not even be allowed. We should all go back to using GOTO.
OOP Can be very useful ( especially for large projects ... ).
The idea is not to make PB an OOP language nor to "gimp" it .
But it would be nice to have a clean and easy to use way to implement a Class based structure ( not only to recycle code ) for example in way of a pre-compiler ( use it or don't use it its up to you ... same thing with jaPBe .. some use it others use the PB IDE - Matter of taste). Am working on a rathe rhuge project atm ... with over 9000 include files ( couldn't solve it another way for order... ) .. and while procedural based surely has its advantages sometimes it would be handy to recycle some basic functions you have to split up otherwise.
*hands kale a towel to bite in ... =)
Cheers, Thalius
The idea is not to make PB an OOP language nor to "gimp" it .
But it would be nice to have a clean and easy to use way to implement a Class based structure ( not only to recycle code ) for example in way of a pre-compiler ( use it or don't use it its up to you ... same thing with jaPBe .. some use it others use the PB IDE - Matter of taste). Am working on a rathe rhuge project atm ... with over 9000 include files ( couldn't solve it another way for order... ) .. and while procedural based surely has its advantages sometimes it would be handy to recycle some basic functions you have to split up otherwise.
*hands kale a towel to bite in ... =)
Cheers, Thalius
"In 3D there is never enough Time to do Things right,
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone!
"
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone!

Purebasic is a procedural language based on BASIC. Why should it have to be re-writen from scratch just to support features that you could achieve in others ways and features that the majority of people (who want to use basic) would not use. To support OOP correctly would take a complete compiler re-write and if you havn't noticed Fred has just finished a major version.
OOP In Purebasic (PDF)
http://www.purebasic.fr/english/viewtopic.php?t=19416
OOP In Purebasic (PDF)
http://www.purebasic.fr/english/viewtopic.php?t=19416
http://www.geocities.com/tablizer/oopbad.htmmp303 wrote:If you have any actual arguments against OOP features, I'd like to hear your reasons. So far I haven't heard any.
What is so terrible about OOP, that you have to protect other PB users from ever touching it?
This is not entirely correct.Kale wrote:.. To support OOP correctly would take a complete compiler re-write and if you havn't noticed Fred has just finished a major version.
It depends how much oop you want...
My little class parser is just 4.5kb in code and 12kb as exe, and it works great.
Still need to implement some stuff but it will not increase the size too much.
This is my oop code:
Code: Select all
;oop example by fsw
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;- start main:
Class MyObject
ValueOfThat.l
AnotherValue.s
This(par.l)
That()
EndClass
NewObject myThing.MyObject
NewObject AnotherThing.MyObject
With myThing
\This(347)
\That()
EndWith
With AnotherThing
\This(123)
\That()
EndWith
myThing\That() ;double check the value
AnotherThing\That() ;double check the value
End
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; for now no constructor or destructor (maybe I will never incude them)
Procedure MyObject_This(*Self.MyObject, par.l)
*Self\ValueOfThat = par
MessageRequester("MyObject", "This: " + Str(par))
EndProcedure
Procedure MyObject_That(*Self.MyObject)
*Self\AnotherValue = " That: "
MessageRequester("MyObject", *Self\AnotherValue + Str(*Self\ValueOfThat))
EndProcedure
structure for address of vtable and properties
interface for methods
declare the methods
datasection is the actual vtable
create new object
Thats it.
Too much oop is bad (IMHO), it will obscure the code.
With V4 this is outdated, but it shows the principle behind it.Kale wrote: OOP In Purebasic (PDF)

This link is pretty old and if you really read through the text you will see that this guy is just promoting his idea of the holy coding grail.Kale wrote:http://www.geocities.com/tablizer/oopbad.htmmp303 wrote:If you have any actual arguments against OOP features, I'd like to hear your reasons. So far I haven't heard any.
What is so terrible about OOP, that you have to protect other PB users from ever touching it?
Didn't see anything that makes me think: "This is good!"
This guy worte down a lot, but his own code proves him wrong, it's longer than the oop code and it's more obscure (IMHO).
As I stated above, too much oop is bad (IMHO), it will obscure the code.
But a resonable amount of object oriented concept can be excellent (IMHO).
