Page 1 of 1
Object Orientation Programming
Posted: Thu May 21, 2009 6:58 pm
by swhite
Hi
Is there any plans to include Object Oriented Programming in PureBasic if not I would like to suggest it.
Thanks,
Simon
Posted: Thu May 21, 2009 7:07 pm
by srod
I think you should do a search of these forums!

Posted: Thu May 21, 2009 8:00 pm
by Kaeru Gaman
Re: Object Orientation Programming
Posted: Thu May 21, 2009 8:29 pm
by Fluid Byte
swhite wrote:Is there any plans to include Object Oriented Programming in PureBasic
No.
swhite wrote:... if not I would like to suggest it.
Don't waste your time. It won't happen.
Posted: Thu May 21, 2009 10:39 pm
by Kale
Just to add flames to the fire, i've been an advocate of PB including a way of natively programming in an OOP way. I don't think it will happen because i think Fred once said it would require a complete redesign of the compiler and he wasn't that 'au fait' with OOP.
I still would like to see it in the future.
For nostalgia, here's an old thread discussing way of achieving as near as damn it OOP techniques:
http://www.purebasic.fr/english/viewtopic.php?t=19416
Posted: Fri May 22, 2009 6:26 am
by Hroudtwolf
Posted: Fri May 22, 2009 8:48 am
by pdwyer
Powerbasic added it. you could try their compiler. not a bad compiler but different mind set behind it.
separate from the home rolled stuff there there are also COM interface includes too like COMmate
Posted: Sun May 24, 2009 2:56 am
by swhite
I know PowerBasic has this functionality but I am very much interested in a cross platform solution. I very much like the speed of Purebasic and small exe size. I realize that you lose some of this with OOP but I program using OOP all the time now and the one big advantage I see is that I can inherit from my base classes in any of my projects. When I improve my base classes all the projects automatically inherit the improvements. In my case I do not even have to recompile my projects. I just drop my improved base classes into the appropriate folder and applications gets all the improvements automatically.
Simon
Kale wrote:Just to add flames to the fire, i've been an advocate of PB including a way of natively programming in an OOP way. I don't think it will happen because i think Fred once said it would require a complete redesign of the compiler and he wasn't that 'au fait' with OOP.
I still would like to see it in the future.
For nostalgia, here's an old thread discussing way of achieving as near as damn it OOP techniques:
http://www.purebasic.fr/english/viewtopic.php?t=19416
Posted: Sun May 24, 2009 11:17 am
by Kale
swhite wrote:I very much like the speed of Purebasic and small exe size. I realize that you lose some of this with OOP
That's not really true. If you organise your program correctly there's no reason why programming using an OOP method won't give you the same size exe and speed.
Posted: Sun May 24, 2009 11:46 am
by djes
Kind of "off-topic" between nature and computer : I was thinking the other day about worms, seeing them just as living intestines. Following this idea, I realised that nature don't fully "inherit" things. Each living organism has characteristics of his ancestors, sometimes not used, but after some time it's cleaned, and unused functions are thrown away. It's giving maximum efficiency.
Just a thought, sorry!

Posted: Sun May 24, 2009 2:42 pm
by blueznl
To be honest, that's a process I go through a few times a day, it often involves soft paper and flushing...

Posted: Sun May 24, 2009 3:54 pm
by Edwin Knoppert
Kale wrote:swhite wrote:I very much like the speed of Purebasic and small exe size. I realize that you lose some of this with OOP
That's not really true. If you organise your program correctly there's no reason why programming using an OOP method won't give you the same size exe and speed.
A misconception.
first.. i like oop 2nd, with oop all functions need to be present due the way the class needs to be exposed.
By using ordinary functions, they may not all been called, a good compiler only includes what get's called.
I am not sure about purebasic but for example the static libs icw the lcc compiler does this.
I assume in most languages using classes your are stuck with the full size of the compiled class.
Posted: Sun May 24, 2009 10:41 pm
by Kale
Edwin Knoppert wrote:Kale wrote:swhite wrote:I very much like the speed of Purebasic and small exe size. I realize that you lose some of this with OOP
That's not really true. If you organise your program correctly there's no reason why programming using an OOP method won't give you the same size exe and speed.
A misconception.
first.. i like oop 2nd, with oop all functions need to be present due the way the class needs to be exposed.
By using ordinary functions, they may not all been called, a good compiler only includes what get's called.
I am not sure about purebasic but for example the static libs icw the lcc compiler does this.
I assume in most languages using classes your are stuck with the full size of the compiled class.
Yes, it depends on the compiler. But OOP does not necessarily equal bloat and slow code. Also, even if a compiler did add a few kb to an exe due to some overhead while compiling using an OOP style, this is nothing compared to the time saving and better organisation of the program.
It's a misconception to think that using OOP in your programs has any bad side effects. It is only a different way of thinking and working. period!