Object Orientation Programming
Object Orientation Programming
Hi
Is there any plans to include Object Oriented Programming in PureBasic if not I would like to suggest it.
Thanks,
Simon
Is there any plans to include Object Oriented Programming in PureBasic if not I would like to suggest it.
Thanks,
Simon
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Re: Object Orientation Programming
No.swhite wrote:Is there any plans to include Object Oriented Programming in PureBasic
Don't waste your time. It won't happen.swhite wrote:... if not I would like to suggest it.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
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
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
- Hroudtwolf
- Addict
- Posts: 803
- Joined: Sat Feb 12, 2005 3:35 am
- Location: Germany(Hessen)
- Contact:
Maybe PB never goes OOP.
But there are multiple ways to still develop OOP like with PB.
Here are just a few examples:
Preprocessor by Sirhc
http://purebasic-lounge.com/viewtopic.p ... 15&start=0
Preprocessor by INC
http://www.purebasic.fr/english/viewtop ... 36&start=0
http://www.purebasic-lounge.com/viewtop ... 69&start=0
Preprocessor by MK-Soft
http://www.purebasic.fr/english/viewtop ... 74&start=0
Preprocessor by FSW
http://www.purebasic.fr/english/viewtop ... 16&start=0
A lot of user class examples
http://www.purebasic-lounge.com/viewforum.php?f=95
Best regards
Wolf
But there are multiple ways to still develop OOP like with PB.
Here are just a few examples:
Preprocessor by Sirhc
http://purebasic-lounge.com/viewtopic.p ... 15&start=0
Preprocessor by INC
http://www.purebasic.fr/english/viewtop ... 36&start=0
http://www.purebasic-lounge.com/viewtop ... 69&start=0
Preprocessor by MK-Soft
http://www.purebasic.fr/english/viewtop ... 74&start=0
Preprocessor by FSW
http://www.purebasic.fr/english/viewtop ... 16&start=0
A lot of user class examples
http://www.purebasic-lounge.com/viewforum.php?f=95
Best regards
Wolf
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
separate from the home rolled stuff there there are also COM interface includes too like COMmate
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
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
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
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!
Just a thought, sorry!

To be honest, that's a process I go through a few times a day, it often involves soft paper and flushing...


( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
-
- Addict
- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact:
A misconception.Kale wrote: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.swhite wrote:I very much like the speed of Purebasic and small exe size. I realize that you lose some of this with OOP
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.Edwin Knoppert wrote:A misconception.Kale wrote: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.swhite wrote:I very much like the speed of Purebasic and small exe size. I realize that you lose some of this with OOP
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.
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!