Page 4 of 6

Posted: Sun Aug 07, 2005 5:49 pm
by Fou-Lu
GedB wrote:A big, big no from me.

If you want OO, then you must have memory management. Preferabbly garbage collection, reference counting at the very least.

Object style coding without the memory management is a bad, bad thing.
How do you know how OOP would be programmed for PB? Maybe there's another way to do that that you don't know yet. :wink:

I myself don't need OO. But if there's someone who needs it, we can only deny when we are sure that this is a "threaten" to PureBasic.

Again: This feature is unnecessary, it will only be added if there are no drawbacks!

Posted: Sun Aug 07, 2005 9:42 pm
by Dreglor
I can see the use of oop

but i think defining a object should be diffrent from above
it should be more like the

Code: Select all

class myobject
  x.f
  y.f
  move(x,y)
  draw()
endclass
define and declare the procedures outside of the class
i think some of the advance features of oop could be acomplished thru pointers and doesn't have to be internal coded in
right now i love just to have just that format in there its basic and looks clean

Posted: Fri Aug 12, 2005 6:13 pm
by fsw
OO or not OO :?:

It always depends what your code tries to accomplish.

I use OO-code (mostly GUI programming) and procedural-code side by side and for me it's the way to go.

Regarding BASIC's and OOP there is:
Extreme Basic (p-code)
SpeedBasic (basic 2 c++)
B++ (basic 2 c++)
Bloc (basic 2 object pascal)
BlitzMax (basic 2 c++)
RapidQ (p-code)
HotBasic (basic 2 asm)
and soon FreeBASIC (basic 2 asm)

The BASIC language of the future is powerful and general purpose - this includes basic OO functionality.
This way you can code however you want.

Posted: Sat Aug 13, 2005 10:29 am
by Kukulkan
Hi you all,

Didelphodon posted in the german forum a oop-pre-compiler which allows you to write code like this:

Code: Select all

Class MyClass1
    attribute1.l

    Method setAttribute1(value.l)
        *this\attribute1 = value
    EndMethod

    Method.l getAttribute1()
        MethodReturn *this\attribute1
    EndMethod
EndClass

Class MyClass2 Extends MyClass1
    attribute2.l

    Method setAttribute2(value.l)
        *this\attribute2 = value
    EndMethod

    Method.l getAttribute2()
        MethodReturn *this\attribute2
    EndMethod
EndClass

NewObject *obj.MyClass2

*obj\setAttribute1(1)
*obj\setAttribute2(2)
Debug Str(*obj\getAttribute1()) + " / " + Str(*obj\getAttribute2())
*obj\destruct()

End
It is simple to use as a little precompiler before you use the pb-compiler. You can find more informations and the precompiler on the german website: http://members.chello.at/pure-basic-essentials/ (try downloads).

The site is in german, but the precompiler works very good. If there would be some good feedback on the forum or guestbook of this site, Didelphodon may extend this much more. He is paused in the moment, cause of some illness but will keep on working on this in future (i hope so).

The best thing on a way like this is, that everybody can choose if he wants to use oop or not. If it was possible to use this as an addin in the pb-ide, everyone would be happy, or not?

Kukulkan

Posted: Sat Aug 13, 2005 10:35 am
by thefool
does the new pb ide support plugins?

Posted: Sat Aug 13, 2005 11:34 am
by geoff
I am against adding OOP.

I have recent experience of javascript with DHTML. So much is implicit (or inherited) that you can't be sure if it will work, why it doesn't work or what you need to do to make it work. And when it does work you can't be sure if it is correct or a lucky coincidence that something you have omitted has taken a correct default value (or property), but will not work in different circumstances.

I think it unrealistic to expect any major addition to PB not to worsen the existing functionality. When anything becomes more complex it becomes more difficult to debug. Notice how each release of PB gets progressively more difficult to get right, notice how each release of Windows takes longer to develop. Complex things tend to be less reliable, look at the Space Shuttle.

Posted: Sat Aug 13, 2005 2:50 pm
by Dare2
Hi geoff.

You probably know this, but in case you dont: You can use JavaScript as a simple or functional (is that the term?) language as well as with in a heavy duty OOPish way. DHTML access to things like, say, stylesheets, require properties, etc, to set/get values, but JS in and of itself needn't have too much reliance on OOP. It had to retain old funtional approach for all the old apps that used it that way.

On the "To OOP or not to OOP" question:

Provided OOPing PB did not break what we have, it is not necessarily a bad thing. Whilst I don't think I personally would use it (the OOP bits) often, there are cases when it would be useful. Esp when dealing with external stuff that is OOPish.

However first PB needs to get it's data types out of the stone age. Even QB (DOS!) had 8 byte floats!

Posted: Sat Aug 13, 2005 3:28 pm
by Truth_Seeker
Kukulkan wrote:Hi you all,

Didelphodon posted in the german forum a oop-pre-compiler which allows you to write code like this:

Code: Select all

Class MyClass1
    attribute1.l

    Method setAttribute1(value.l)
        *this\attribute1 = value
    EndMethod

    Method.l getAttribute1()
        MethodReturn *this\attribute1
    EndMethod
EndClass

Class MyClass2 Extends MyClass1
    attribute2.l

    Method setAttribute2(value.l)
        *this\attribute2 = value
    EndMethod

    Method.l getAttribute2()
        MethodReturn *this\attribute2
    EndMethod
EndClass

NewObject *obj.MyClass2

*obj\setAttribute1(1)
*obj\setAttribute2(2)
Debug Str(*obj\getAttribute1()) + " / " + Str(*obj\getAttribute2())
*obj\destruct()

End
It is simple to use as a little precompiler before you use the pb-compiler. You can find more informations and the precompiler on the german website: http://members.chello.at/pure-basic-essentials/ (try downloads).

The site is in german, but the precompiler works very good. If there would be some good feedback on the forum or guestbook of this site, Didelphodon may extend this much more. He is paused in the moment, cause of some illness but will keep on working on this in future (i hope so).

The best thing on a way like this is, that everybody can choose if he wants to use oop or not. If it was possible to use this as an addin in the pb-ide, everyone would be happy, or not?

Kukulkan
Very intresting, I tried to look at the site using WorldLingo. The IDE and precompiler that was being made there looked great. Do you think there might be a English version?

What Fred wants is fine with me

Posted: Sat Aug 13, 2005 11:18 pm
by pantsonhead
I won't complain if PB never supports OOP.

I expect it would take a LOT of time and effort to implement and it will still won't be "right" for some users.

I use OOP in other langauges and when you need it, it's great.
But I haven't missed it it PB yet. If it ever did come along in PB, I would hope it was so transparent
that you could ignore it unless you decided to use it.

I'd rather Fred spent time getting OSX version finished before starting something extra like this.

I love PB for what it is now so whatever Fred wants is fine with me.

Posted: Sun Aug 14, 2005 9:24 pm
by GedB
I'd love to have PB support OO properly.

It takes a lot more than just allowing an OO style syntax to do OO.

Posted: Mon Aug 15, 2005 12:17 pm
by SoulReaper
hello all :)

I voted yes the reason is pure basic is a basic and yes good for beginners and advanced - but the reason I bought it was I was looking for a next generation language and i looked at loads of differnt basics...

I believe i have found the langauge and it is called pure basic and in time it will prove itself :wink:

very few basic use machine code inline which is a big plus
just to show the power JAPBE editor is written in Pure Basic!
ok I have said enough :roll:

love beating that pure basic drum :twisted: :lol:

Kevin

Posted: Mon Oct 24, 2005 3:26 pm
by porfirio
I like very mutch pb as i like VB.NET.
The OO is very cool and gives you alot of vantages.

I would love to see a programing language like javascript
Its the most cool OO language and you can do esey classes with sub classes and vars etc.
Sadly theres no JS for programing only for scripting in webpages etc...
have you imagined this?

Code: Select all

hwnd=new Window(10,10,500,400,#pb_system_menu,"my win")
btn=new hwnd.Button(5,5,72,20,"OK")
btn.click=function(e){
   MessageRequester("My app","You clicked button")
   hwnd.title="I changed the title :p"
   btn.value="New value on the button !!"
}
That would be so cool!!
But its kinda impossible :(

Posted: Mon Oct 24, 2005 5:22 pm
by Nik
Why don't you learn real Java then its not the same but it is a good OO developing language

Posted: Mon Oct 24, 2005 6:30 pm
by Joakim Christiansen
It looks like PureBaisc is never going to have OOP, so we should just stop talking about it.

Posted: Mon Oct 24, 2005 7:27 pm
by Truth_Seeker
I get that feeling too :(.