OOP Support (it is time)
Re: OOP Support (it is time)
What if Fred developers a OO PB compiler and charges x2 the cost of the current PB compiler, as well as annual maintenance cost? Would that be ok? I've been looking around forever for a 1/2 way decent OO Basic language w/o a runtime. PB seems the only candidate with that possibility.
Re: OOP Support (it is time)
There is "partial OOP support" ... known as "Interface" like Trond hasDaylightDreamer wrote:But i think it is really time to add unless partial OOP support in it.
posted it. If you need more "OOP-like"restrictions, then you need
another language.
MFG PMV
Re: OOP Support (it is time)
As far, as I'm concerned, it is not about restrictions at all,PMV wrote:There is "partial OOP support" ... known as "Interface" like Trond has
posted it. If you need more "OOP-like"restrictions, then you need
another language.
but about an easy way for clean, orderly programming.
Looking at Tronds example above, I see a lot of fussing around,
with code distributed all over,
something, people like me, would need a very, very good reason to use at all.
Now, do have a look at the Procedures inside Structures thread
and see, how nice and easy it can be ...
If liberty means anything at all, it means the right to tell people what they do not want to hear.
- George Orwell
- George Orwell
Re: OOP Support (it is time)
I agree with Marlin here. Why so messy and disjointed?
And PMV
And PMV

Why are you always so quick to send people to other programming languages?PMV wrote:If you need more "OOP-like"restrictions, then you need
another language.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: OOP Support (it is time)
Why so messy and disjointed?
Because interfaces were added to support oop libraries and not to create oop code with purebasic.
If you want nice clean oop code, use a pre-compiler. Does it for me.
There are still parts of the oop philosophy missing, but it's a start.
Before whining in 10+ threads about a feature that Fred "allegedly" (Haven't actually seen this post, but some people here said so unanimous) said will probably never be added to PB, why don't you use some of those pre-compilers?!
And because of this (Fred's statement), I reckon PMV suggested to use another language.
Another Thread won't change Fred's mind. He's well aware of the advantages and disadvantages of OOP and he alone can decide whether to add this feature to PB, or not.
After all he's the one to maintain the code etc...
Bottom line: Stop opening anymore threads about a topic that has been discussed for years over and over again.
Use a pre-compiler like Simple-OOP or switch to, or at least use another language in addition to PB, if you think, you can't live without OOP.
Because interfaces were added to support oop libraries and not to create oop code with purebasic.
If you want nice clean oop code, use a pre-compiler. Does it for me.
There are still parts of the oop philosophy missing, but it's a start.
Before whining in 10+ threads about a feature that Fred "allegedly" (Haven't actually seen this post, but some people here said so unanimous) said will probably never be added to PB, why don't you use some of those pre-compilers?!
And because of this (Fred's statement), I reckon PMV suggested to use another language.
Another Thread won't change Fred's mind. He's well aware of the advantages and disadvantages of OOP and he alone can decide whether to add this feature to PB, or not.
After all he's the one to maintain the code etc...
Bottom line: Stop opening anymore threads about a topic that has been discussed for years over and over again.
Use a pre-compiler like Simple-OOP or switch to, or at least use another language in addition to PB, if you think, you can't live without OOP.
Re: OOP Support (it is time)
The answer is very simple. Fred have tell all of us the fact that PureBasic will not become an OOP language sooner or later. It's very annoying to read an Features Requests about OOP over an over again.skywalk wrote:Why are you always so quick to send people to other programming languages?
OOP does not guaranteed that your program will be more structured. (I have see so many OOP C++ code that are so badly coded. It's a miracle that the compiler can eat a code like that without crashing the OS it's self). When the code is just a piece of junk, it's a piece of junk whatever if it's written in C, C++, C#, ADA, ASM, Fortran, PureBasic, MatLab, Excel VBA, Delphi, name it.
The be honest I hate OOP because I don't like when a programming language restrict me like the C++ way. I prefer to restrict my self to my programming rules with PureBasic and the BOP techniques. What is BOP you say ?
Based Object Programming or if you wish Structures and Pointers and they are already supported by PureBasic. The BOP techniques has been used in C longtime ago, just before the C++ come to life. In my point of view, the BOP is perfectly suitable techniques for a Basic programming language.
So my question is :
If you like an OOP language why did you purchased or use PureBasic in the first place ?
Best regards
Guimauve
Re: OOP Support (it is time)
@Gimauve,
1st, this is not my topic.
I merely commented on the current workarounds and how they appear clumsy and wanted to applaud the excellent incremental suggestions to improve the encapsulation of methods.
2nd, Feature Requests is open...
There is no mention of "all requests welcome except OOP stuff!"
3rd, I never claimed OOP was my mantra of coding. Actually, I agree with you in general. Still, there is no reason OOP cannot coexist in your structured coding tool bag, if carefully applied.
Finally, my choosing of PureBasic is irrelevant.
My ignorance of, or resistance to improvements of PureBasic is not.
...waiting on 4.6++
1st, this is not my topic.
I merely commented on the current workarounds and how they appear clumsy and wanted to applaud the excellent incremental suggestions to improve the encapsulation of methods.
2nd, Feature Requests is open...
There is no mention of "all requests welcome except OOP stuff!"
3rd, I never claimed OOP was my mantra of coding. Actually, I agree with you in general. Still, there is no reason OOP cannot coexist in your structured coding tool bag, if carefully applied.
Finally, my choosing of PureBasic is irrelevant.
My ignorance of, or resistance to improvements of PureBasic is not.

...waiting on 4.6++

The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
-
- Addict
- Posts: 1482
- Joined: Tue Feb 22, 2011 1:16 pm
Re: OOP Support (it is time)
But when you're requesting something that has specifically, clearly and repeatedly had a "no" answer in the past in many topics, then such requests are just seen as whining. In other words, yes the feature requests is open, but not open to abuse. It's open for fresh requests, not repeated bleating.skywalk wrote:2nd, Feature Requests is open...
There is no mention of "all requests welcome except OOP stuff!"
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
PureBasic: Born in 1998 and still going strong to this very day!
Re: OOP Support (it is time)
Another way:
Code: Select all
Interface IPerson
Shout(Msg.s)
Whisper(Msg.s)
EndInterface
Structure SPerson
*Interface
Name.s
EndStructure
Procedure IPerson_Shout(*Self.SPerson, Msg.s)
MessageRequester("Shout!", *Self\Name + ": " + UCase(Msg))
EndProcedure
Procedure IPerson_Whisper(*Self.SPerson, Msg.s)
MessageRequester("Whisper!", *Self\Name + ": (shhh!) " + Msg)
EndProcedure
Procedure Person(Name.s)
Protected *Self.SPerson = AllocateMemory(SizeOf(SPerson))
With *Self
\Interface = ?IPerson
\Name = Name
EndWith
ProcedureReturn *Self
EndProcedure
Bill.IPerson = Person("Bill")
Bob.IPerson = Person("Bob")
Bill\Shout("Hello world!")
Bob\Whisper("Goodbye, world!")
DataSection
IPerson:
Data.i @IPerson_Shout()
Data.i @IPerson_Whisper()
EndDataSection
Re: OOP Support (it is time)
But it is. You can write Code with "Interfaces" like you write it inMarlin wrote:As far, as I'm concerned, it is not about restrictions at all,
but about an easy way for clean, orderly programming.
C++. Yes, there are some missing functionality in Interfaces like
full inheritance or a missing "class"-keyword.
What the problem is, there are no restrictions in manipulating
the "interface-objects" and you can call any procedure at any point.
No restricted scopes of procedures possible.
The lack of restrictions to have to write code OOP-like is what all
are missing. You can write code like Trond has posted it. And a
second developer can change anything. Changes that shouldn't
possible in OOP.
Java is an example of a language, that has this restrictions, but
allows procedural code. So you aren't forced to use OOP, but
it is good practice. OOP is nothing special. I mean, i can write code
OOP like or procedural, it is all the same for me. Other people
can not jump between OOP and procedural. Some need OOP, some
doesn't understand the case and want procedural or something else.
If PureBasic learns OOP, i think i will use it too. Sometimes. But
for big projects, OOP is not always the best choice. It is the language
itself what makes the difference. If you need OOP, then use a OOP-
language. I doesn't have a problem, when someone doesn't use PB.
A language is nothing more than a tool. You doesn't use a unhandy
hammer if you want it handy.

What would more help than full OOP-restrictions is something like this:
Modules

MFG PMV
Re: OOP Support (it is time)
And one of these Precompilers also does provide a PB-"native" Code output: http://www.purebasic.fr/english/viewtop ... 14&t=30236TomS wrote:If you want nice clean oop code, use a pre-compiler. Does it for me.
So when compiling the precompiler does generate a temp codefile in the users system temp directory.
Just catch that one and you easely can use this PB-Native Codeoutput for sharing with people not having the precompiler installed like in the forum i.E.
And BTW. that codepart also enjoyed codebeautyfying like auto-indentation and auto-spacings etc.
I intended to make this "pb-oop2pb-code" translation available via functionkey in the IDE, but I stopped developing that project due to low user usage.
Cheers
Check out OOP support for PB here!
Re: OOP Support (it is time)
@PVM
Again: I am not talking about restrictions
and certainly not about anyone being forced to use
a certain programming paradigm.
I like PB very much as it is,
especially the speed and simplicity.
Tronds examples are quite helpful,
especially to get ideas,
but, I'd say again, I'd need a very, very good reason to use PB in such a way.
(It can not currently be without some unavoidable amount of unneeded involvement.)
Reading into this Modules thread (admittedly not in complete detail),
I get the idea, that this would require more fundamental changes.
And this is something, Fred could conceive of (some years ago).
Using precompilers, is not something that looks nice, simple and easy to me either.
The Procedures inside Structures concept does look to me like a comparably small,
but nice and significant improvement to PB,
building on what is allready there, not requiring any fundamental changes.
Just a nice and simple new feature,
no obligation to use it and no need to change any existing [user] code required.
You can put your code, where it belongs and not have issues
with naming collisions with procedures in other structures or the main source.
(This naming thing would be one of the mayor advantages.)
Again: I am not talking about restrictions
and certainly not about anyone being forced to use
a certain programming paradigm.
I like PB very much as it is,
especially the speed and simplicity.
Tronds examples are quite helpful,
especially to get ideas,
but, I'd say again, I'd need a very, very good reason to use PB in such a way.
(It can not currently be without some unavoidable amount of unneeded involvement.)
Reading into this Modules thread (admittedly not in complete detail),
I get the idea, that this would require more fundamental changes.
And this is something, Fred could conceive of (some years ago).

Using precompilers, is not something that looks nice, simple and easy to me either.
The Procedures inside Structures concept does look to me like a comparably small,
but nice and significant improvement to PB,
building on what is allready there, not requiring any fundamental changes.
Just a nice and simple new feature,
no obligation to use it and no need to change any existing [user] code required.
You can put your code, where it belongs and not have issues
with naming collisions with procedures in other structures or the main source.
(This naming thing would be one of the mayor advantages.)
If liberty means anything at all, it means the right to tell people what they do not want to hear.
- George Orwell
- George Orwell
-
- User
- Posts: 52
- Joined: Wed Feb 04, 2009 8:11 am
- Location: Armenia
Re: OOP Support (it is time)
I like this "the Procedures inside Structures thread" idea.
I think it solves a lot.
I think it solves a lot.
Re: OOP Support (it is time)
Oh that is a fancy statement. Have you checked out RealBasic or for that matter the new version of PowerBasic? I don't have anything against PB but there are alternatives.X wrote:I've been looking around forever for a 1/2 way decent OO Basic language w/o a runtime.
--
Yogi Yang
Yogi Yang
Re: OOP Support (it is time)
RealBasic is slow and bloated. PowerBasic has syntax from the stone age and terrible support. I wouldn't call them decent alternatives.Yogi Yang wrote:Oh that is a fancy statement. Have you checked out RealBasic or for that matter the new version of PowerBasic? I don't have anything against PB but there are alternatives.X wrote:I've been looking around forever for a 1/2 way decent OO Basic language w/o a runtime.