Object Orientation Programming

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
swhite
Enthusiast
Enthusiast
Posts: 789
Joined: Thu May 21, 2009 6:56 pm

Object Orientation Programming

Post by swhite »

Hi

Is there any plans to include Object Oriented Programming in PureBasic if not I would like to suggest it.

Thanks,
Simon
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

I think you should do a search of these forums! :)
I may look like a mule, but I'm not a complete ass.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

Image
oh... and have a nice day.
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Re: Object Orientation Programming

Post 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.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post 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
--Kale

Image
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

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
User avatar
pdwyer
Addict
Addict
Posts: 2813
Joined: Tue May 08, 2007 1:27 pm
Location: Chiba, Japan

Post 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
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
swhite
Enthusiast
Enthusiast
Posts: 789
Joined: Thu May 21, 2009 6:56 pm

Post 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
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post 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.
--Kale

Image
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post 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! :wink:
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

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

:wink:
( 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... )
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post 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.
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post 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!
--Kale

Image
Post Reply