OOP in PB?

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

OK.
That's an answere which I could live.
I can understand if you say that the PB team wants to create a pure procedural language.

Maybe it's time for PB to be developed by more than one team. And by more than one idea.
I think that would be a lot of fun.

Thank you for your very concret answer. :)
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

I wish we could have a rational discussion about OO, because it always disintegrates like this.
simple-to-use OOP-like features built in
The question is, what are OOP-like features?

Inheritance? PB already has this for structures, and I've never seen it being used. Leading OO developers recommend composition over inheritance. Composition in PB is trivial. http://c2.com/cgi/wiki?CompositionInsteadOfInheritance

Garbage Collection? C++, delphi and Objective-C manage fine without it.

When people ask for OO, what is they feel is missing? My attempt to move this to another thread in the proper 'General Discussion' forum failed miserably, so is it possible to find out?
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Post by remi_meier »

Actually, all I really want are modules. And Fred even said that it sounds
like a good idea and that they will think about how to implement it best.

I'm waiting. :wink:
Athlon64 3700+, 1024MB Ram, Radeon X1600
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

Remi,

I see you've added to my original module suggestion.

http://www.purebasic.fr/english/viewtop ... ght=module

I suspect that Modules is what most people really want when they ask for OO. A way to organise bigger projects.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

A Userdefined Scope for Functions and Variables is required. I think Module is the same
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Post by remi_meier »

Yeah :wink:
It doesn't need to be complex, but just the possibility to hide some procedures
and global variables from other procedures.

OOP is one step further, I would like to see it too, but modules would really
be enough. They just need yet another way of programming and organizing.
Athlon64 3700+, 1024MB Ram, Radeon X1600
Brice Manuel

Post by Brice Manuel »

You know, the more you keep trying to insult people the more idiotic you sound.
What is sad is that is an insult to Fred, not me.
I think you and brice idiotic your sounds with your total stupic contra against OOP in PB.
I am not against OOP in PB. Fred is, therefore whining and instigating flame wars isn't going to change things.
What is your problem?
Fred said no, what is your problem?
@Brice: Keep calm, we did get it for the first time, you don't need to repeat it again and again.
Evidently I do need to keep repeating it, because you keep throwing a tantrum and whining for something even when Fred has already said NO many times.
I don't know what is pricking you.
Pricks like you?
The only you do here is trolling against our wish for a OOP support in PB.
The only ones trolling are a couple of childish users who keep asking for something even though Fred has said no many times.
..and all the other people are stupid?
No, but apparently the OOP whiners are.
And now, a big part of the community wishs to have a new feature.
And Fred has said, NO. Learn to deal with it.
But without OOP haves PB and myself no future.
Trust me, the fact that you have no future has NOTHING to do with the lack of OOP in PB.
I think this discussion on OOP should remain open and active, and anyone who has only "Fred said no" to say about it should maybe refrain from hitting the submit button.
Those who cannot accept that Fred has said no, should refrain from posting.
"Fred says no" over and over again offers no substance.
It does offer the TRUTH!
Our wish goes to Fred and not to you or Brice.
Fred has said no. My wish has nothing to do with it.
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

freak wrote:Let me get some stuff straight...

1) Freds primary motivation for taking another job was not the money alone.
He was bored from working at home and needed to get back into a larger team (company)
to work together with other people.

2) PB will never be one of the top programming languages, but the reason for this is far from this OOP discussion.
I have heard this argument a lot over the years: "PB is great, but if freature X were implemented, it would be number one in the world"
Feature X would be whatever that person wanted at the moment, so for you it is OOP.

What you guys need to accept is that this is not true. It is not about features.
To get to the top, you need a big company, which can pay a ton of people
for the single task of writing the documentation, let alone for the coding,
and most importantly which will invest a huge amount of money for marketing and such.
Well, buying out the competition helps that process as well... ;)

Either that, or you manage to create an industrial standard (like c++), for which
multiple companies write compilers, but the chances for that happening with PB are even lower.

We are a small team, who work on PB in their spare time. We are doing this for fun,
not to conquer the world. I think you have to understand that.

3) The decision agains OOP in PB is not based on ignorance.
We know the concept of OOP very well. Both Fred and I have a lot of experience
with OO based languages, and are using them very often.

So the decision against OOP in PB is not based on our hate for the concept,
or because we think procedural programming is in some way superior,
but simply because we think it would not be good for the community.
Fred has explained this before: We do not want to split the community
into an OOP and a non-OOP camp.
There are many OO based languages out there, even among the basic languages.
Nobody forces you to stick with PB forever. If you don't like it, you move one.
That is what programmers do. Choose the right tool for your task.
Don't choose your tool and then wait for it to adapt to your task. Makes sense, doesn't it ?

I do not see why we should reinvent the wheel here. There are many great OOP languages
out there. PB does not need to try to be one of them.
We try to create a good procedural language here, because those have their purpose as well.


On a sidenote, about the "Beginners vs Professionals" argument:

In my opinion it is a common mistake among programmers to try to define
themselves as "professional" based on what tools/languages they use:

- The C guys think they are superior because everybody who does not understand pointers is a wimp.
- The Java guys think they are superior because pointers are just evil.
- ...

What you have to realize is that the end user does not make this distinction.
He does not judje your work based on the language it is written in (he does not care),
but simply on how well your product works.

So, if you think you need to have OOP features, just because that makes you look more professional,
well... maybe it is time to grow up.

To sum it up:
Real OOP in PB is not going to happen any time soon.
That does not mean you are not entitled to your opinion that it would be good in PB, or that you cannot keep requesting it, but maybe you should consider
that it will not happen anytime soon, and consider some alternatives if you really need it.

Moving on to new programming languages is not a big deal... its what programmers do... ;)
Very inteligent explanation.

I guess there is no more need to discuss about OOP and PB.
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

Brice,

We had just managed to get some adult conversation going, could you please not spoil it?

Thanks,

Ged.
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

Maybe is time to discuss about PB's pet.

Im NOT happy with the mascot for PureBasic and im sure that as long as PB has this mascot will not grow to be a industrial standard language!!

*Is this pet/guy the one of some very old TV show about a car?
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

Instead of trying to port PureBasic to .Net or OOP or anything else, why not just develop an 'add on' product to give those capabilitites when used with PureBasic. Then those that want just PureBasic buy just Purebasic, and those that want OOP buy the OOP add on, and those that want .Net buy the .Net add on - etc....This way there is no need to argue over if it should be added or not, another product is added to the line, more profit, and more choices for people, which is something that other 'basic' languages don't offer.
Brice Manuel

Post by Brice Manuel »

Instead of trying to port PureBasic to .Net or OOP or anything else, why not just develop an 'add on' product to give those capabilitites when used with PureBasic.
Many would buy a preprocessor for PB that would easily allow them to code OOP.
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Here my $0.02 :

I've read most of the posts in this thread (skipped the ones that are really ridiculous..) and don't want to go into details about how certain people react in this matter.

Anyway, my take on this is that there are not enough people in the PureBasic community interested in OOP.


Because I was interested in OOP with PureBasic, I made a preprocessor that is able to create PureBasic code from OOP style code. The feedback is actually non existent, and my impression is that some PureBasic users (specially on PBLounge) don't like it because it doesn't use/promote the naming convention these users agreed on.

This is fine, don't have a problem with that. Everybody is entitled to use what they want.


Also there have been some limitations (bugs) in PureBasic with prototypes and strings which aren't fixed as of yet... (which would have been necessary to create private methods.)

This is fine too, the PureBasic coding team has better things to do than fixing stuff "I" needed to have fixed in PureBasic many moons ago.


Bottom line:
In my case I use PB only for quick and dirty stuff when I want to try things out, but use other languages to do the final job.

Why?
Because what I figured out for myself is, that the bigger a program becomes the more readable it stays if OOP is used to a certain extend.

As I said: IN MY CASE, your mileage may vary.


BTW:
An example that a programming language can be used for procedural and oop coding style is FreeBasic. The classes are not done yet (with inheritance and other stuff), but types (structures) have VARIABLES, PROPERTIES with SET/GET mechanism, SUBS/METHODS and it works really fine.
As a test I've done a gui class which works as expected.
It's compiled as MODULES into a LIBRARY which results in small EXE's:

Code: Select all

CREATE myApp AS QAPP
CREATE myForm AS QFORM

myForm.Show
myApp.Run

end
This code (RQ style) results in a 22KB exe (coded in oop) .


My conclusion:
code whatever you want with the programming language that is best suited for the job.

But don't forget that life is more than coding :P
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> Maybe it's time for PB to be developed by more than one team

I can't believe comments like this. PureBasic doesn't support OOP, so all of
a sudden it might need development by others? :roll: PureBasic's future should
be decided by its creator alone, not by its users. PureBasic is not open source.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

@Brice, Kale & PB....

your noses are totally brown :lol:
Locked