Easy OOP features

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

If we seriously want OOP we should do something about it. Like define a syntax, etc.

This thread: starts the discussion for those who wish to participate.
Dare2 cut down to size
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

What also needs to be discussed is what parts of oo we like and want to implement.

Hope that there is nobody that wants the whole oop stuff :wink:
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

I know i'm no where hear an expert on this matter, and...I think that OOP (s) is something you say when you make a mistake....but I have a couple of questions. I can kinda see from the examples why someone might want to do the OOP thing, but why would you try to force this into PureBasic when it was not intended to do OOP (not really)? Why not just build an add-on interface (or a tool - or something - a Plugin?) for PB that lets you do OOP in PB?
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

SFSxOI wrote:... but why would you try to force this into PureBasic when it was not intended to do OOP (not really)? Why not just build an add-on interface (or a tool - or something - a Plugin?) for PB that lets you do OOP in PB?
This is exactly what I'm gonna do.

There are also already plug-ins available in the german forum.
mp303

Post by mp303 »

thefool wrote:
theNerd wrote: I see two arguments on this board. If something about PureBasic is critized as not being similar to any other BASIC the common reply is "well, your first mistake is to consider it a BASIC language." If something is recommended that may not be considered part of the BASIC language (never mind that most BASIC languages do include classes now) the response is "this is a BASIC language and OOP doesn't belong in BASIC".
This is a really great and TRUE argument!
"The world is what it is, and nothing must ever be allowed to change".

Awesome argument there. Are you going to start a church and write a bible?
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

mp303,

Do you use a translator service, English to Danish?

If not, did you understand what was said in the text you quoted?

Did you read it fully?


:lol:
Dare2 cut down to size
mp303

Post by mp303 »

SFSxOI wrote:...why would you try to force this into PureBasic when it was not intended to do OOP (not really)? Why not just build an add-on interface (or a tool - or something - a Plugin?) for PB that lets you do OOP in PB?
Well, simply, to do that in any future-proof manner, you'd pretty much have to make a parser/compiler on top of the existing parser/compiler. Which means, any changes to the PB language would have to be continously supported and implemented in that language you put on top of it.

Wether PB was "intended" to do OOP or not, is debatable I guess? In light of the fact that it is possible to do OOP with the current language features - it has support for OOP. But it's a very awkward syntax - a limited work-around solution at best, mostly (as I understand it?) intended for compatibility with external object-oriented APIs such as COM, correct?

Basically, all I'm asking for is some additions to the syntax to make this easier. I don't want PB turned into a distinct OOP-centric language such as C++ or Java anymore than you do. If that's what I wanted, I'd be using C++ or Java, wouldn't I?
mp303

Post by mp303 »

Dare wrote:Did you read it fully?
I misunderstood you, sorry - I thought you were referring to the last argument, "this is a BASIC language and OOP doesn't belong in BASIC" - I thought you were saying you agreed with that. Sorry about that! :)
mp303

Post by mp303 »

SFSxOI wrote:Why not just build an add-on interface (or a tool - or something - a Plugin?) for PB that lets you do OOP in PB?
There are other issues with this ... error-tracking, debugging - this would be a serious issue. Because line-numbers would differ in the intermediary output from the OOP layer, they can no longer be directly correlated to where an error occurs.

Also, when you stick function-pointers inside structures, you can no longer (at least not easily, as far as I can figure) do parameter checking and reference this to the underlying function.

There are plenty of other problems with this approach.

In the end, to resolve all of these problems and build a solid OOP layer on top of PureBasic, you would need to write your own compiler, but if you're going to have to go that far, you might as well just write your own programming language.

What I'm looking for, is nowhere near that drastic.

I would just like some basic OOP keywords, not "the whole shebang", e.g. nothing at the complexity level of C++ or Java. Not at all. Probably more in the vicinity of something like VBScript or JavaScript.

I wouldn't like PB's excellent performance to suffer under this, of course. I want as little run-time checks as possible - and as many compile-time checks as can possibly be done. Or at the very least, the ability to switch off all runtime checks once you're ready to deploy.

And these features may of course not be allowed to imply any negative effects on the filesize or performance of linear (non-OOP) programs.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

Awesome argument there. Are you going to start a church and write a bible?
can seem ironic.. I hope you did notice that theNerd thinks that the OOP idea is good, and that people always come with a stupid argument why pb shouldnt support oop?

If they say its a basic, then its not a basic. If they want something not particular basic, then its a basic..
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

hehe.

In another thread mp303 says he doesn't want to be involved in a barroom brawl.

He is involved in about 3 different brawls and doesn't realise it. This guy is sharp as! :P

Problem is, he doesn't read the posts. He scans them briefly, and the only words he sees are those that fulfill his expectations. He is slowly involving former allies and neutrals in his barroom brawl, fewer and fewer on his side.

One wonders how he goes reading program specifications and user requirements. :D It might explain why after all these years as a professional programmer that is all he still is. :twisted:

He's one of yours, thefool (Danish). Can you take him back and lock him away somewhere?
Dare2 cut down to size
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

hehe :D

Well, better not start a flamewar here.. A lot of people only scans the posts, happens for me sometimes too. But you gotta agree the results are funny most of the time :lol:

I'll see if i can hunt him down :p
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

:D
Dare2 cut down to size
mp303

Post by mp303 »

Dare: as said, I'm not going to respond to anymore of your personal attacks. It's obvious how you keep using these personal remarks as a means of avoiding the original topic.

But I'm not going to give you that satisfaction. Find somebody else to insult, if that's what gets you off.

And I'm not going to repeat myself again - you've seen the question above. Stay on topic, or stay out of it.
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

mp303 wrote:And I'm not going to repeat myself again - you've seen the question above. Stay on topic, or stay out of it.
Or? :lol:





Edit: But you're right, I should ease off.
Dare2 cut down to size
Post Reply