Page 2 of 4
Posted: Wed May 31, 2006 1:03 pm
by Kale
... i'm going for a lay down somewhere.
Posted: Wed May 31, 2006 1:06 pm
by Kale
Dare wrote:Be nice Kale, opinions are opinions, not declarations of war against you personally.It wasn't an argument until you started up.

it just winds me up that people keep insinuating that PB is somehow gimped because it isnt an OOP language.
Posted: Wed May 31, 2006 1:21 pm
by benny
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

Posted: Wed May 31, 2006 1:33 pm
by MLK
as purebasic is a very nice language to start coding with, it would make sense to support OOP. i would really like to get as easy in contact with OOP as i got in contact with PP.
Posted: Wed May 31, 2006 1:44 pm
by Dare
Kale wrote:... i'm going for a lay down somewhere.
hehe. Not for too long, I hope. You have a book to finish and I for one am looking forward to reading it.
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.
Posted: Wed May 31, 2006 2:11 pm
by dracflamloc
"Face it, the world is object-oriented - to resist it, is just unnatural."
Well the world is OO but computers are procedural. Thats why C++ OOP is so inefficient when compared to a well written C app.
That said, a preprocessor for OO might not be a bad idea.
Posted: Wed May 31, 2006 2:28 pm
by Straker
Posted: Wed May 31, 2006 2:32 pm
by dracflamloc
Yea I take that back. I was just bored. Definitely sticking with C++ for my OO needs.
Posted: Wed May 31, 2006 3:09 pm
by mp303
Kale wrote: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.
because Purebasic is NOT an OOP language!
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.
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?
Posted: Wed May 31, 2006 3:27 pm
by mp303
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.
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?
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.
Posted: Wed May 31, 2006 3:30 pm
by Thalius
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
Posted: Wed May 31, 2006 3:35 pm
by Kale
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
mp303 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?
http://www.geocities.com/tablizer/oopbad.htm
Posted: Wed May 31, 2006 4:15 pm
by thefool
They can call it "easy object oriented programming" all they want. Its NOT efficient, nor easy and readable.
Posted: Wed May 31, 2006 4:28 pm
by fsw
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.
This is not entirely correct.
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
This is translated to:
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:
mp303 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?
http://www.geocities.com/tablizer/oopbad.htm
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.
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).

Posted: Wed May 31, 2006 4:35 pm
by Dare
fsw wrote: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).

You are being reasonable, rational and balanced. Stop it at once!
