What function of OOP pb can't create ??

Everything else that doesn't fall into one of the other PB categories.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5528
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

What function of OOP pb can't create ??

Post by Kwai chang caine »

Hello at all,

Since several years, i see numerous thread and numerous code talking about OOP. 8)
But nothing really finished :|

Personnally, i not like OOP, and not really all understand to it.

Justly, like i don't know anything about OOP, i wonder way all this code have not full, and what functions of OOP cannot be created in PB.

In one word, what is the différence between the oop source of eddy, and other members, and a real oop code ?
http://www.purebasic.fr/english/search. ... mit=Search

Like Comate adding at PB the full power of OLE with just one pbi...
Is it too much long, too much difficult, or really impossible to create a full PBI of oop with the same number of functions like the c++ for exampler ??

And if it's impossible...and for good understanding, what is the list of things PB never can do :wink:

Thanks in advance for your explanation and have a good day
Last edited by Kwai chang caine on Wed Dec 02, 2015 1:30 pm, edited 2 times in total.
ImageThe happiness is a road...
Not a destination
HanPBF
Enthusiast
Enthusiast
Posts: 570
Joined: Fri Feb 19, 2010 3:42 am

Re: what function of OOP pb can't create

Post by HanPBF »

Hello kcc,

imho OOP is a compiler/tool supported way of source modularization.

When it started some decades ago, many thought software development would become industrial like building a house.
But they forgot that in software the user can turn its house with the move of the sun...

Meanwhile, the wording is really bad; "OOP" are too many things in too many environments.
So, you cannot easily say: "put OOP into PB, please!".

Why so many again and again want OOP in PB is the tooling they see in Eclipse or Visual Studio which is far beyond what PB IDE can do. Very often the basics are ignored...

The next update for VS2015 does include textmate like grammar definitions, so it will be possible to implement PB for Visual Studio (syntax highlighting, intellisense); and pressing F5 would start the PB compiler.

As a less than 10 persons enterprise, the PB team should jump on that train (when possible on MacOS and Linux).

https://www.visualstudio.com/en-us/news ... e1-vs.aspx
HanPBF
Enthusiast
Enthusiast
Posts: 570
Joined: Fri Feb 19, 2010 3:42 am

Re: What function of OOP pb can't create

Post by HanPBF »

To answer the main question: "What function of OOP pb can't create"

None! It's about tools.

In classic OOP like JAVA, the first argument is the object and the function/procedure is then called method.

JAVA: "Test".alert(); //o.k., it's Scala...
PB: alert("Test")
CLOS/LISP: (alert "Test")

In CLOS, more than the first argument is used to find the implementation (multiple dispatch):
(alert "Test" 1) differs from (alert 1 "Test")

PB implements "no-dispatch" or module-dispatch; You need to exactly call the procedure by name:
replaceInStringTheStringByStringOnlyOnceRespectCase(...)
The long name is only to show what may happen; of course You have optional parameters.
But without dispatching, names get long...
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5528
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: What function of OOP pb can't create

Post by Kwai chang caine »

None! It's about tools.
Already a really important answer at one of my main questions
Thanks for your answer 8)
Why so many again and again want OOP in PB is the tooling they see in Eclipse or Visual Studio which is far beyond what PB IDE can do. Very often the basics are ignored...
I think one of the better point of PB, is his small installation, his USB portable configuration, his fast speed to compile, ...

For me, it's this points, who forced me to use PB (and also the facility to create standard DLL 8) )
Perhaps it's for that, numerous persons whant the OOP in PB, for have his strong points and also the advantage of OOP ?? :D

Because VS is really a big pachyderm

Image

against PB
Image
PB implements "no-dispatch" or module-dispatch; You need to exactly call the procedure by name:
replaceInStringTheStringByStringOnlyOnceRespectCase(...)
The long name is only to show what may happen; of course You have optional parameters.
But without dispatching, names get long...
I not use it too :oops: , but with the module, you can fix this problem no ??
ImageThe happiness is a road...
Not a destination
HanPBF
Enthusiast
Enthusiast
Posts: 570
Joined: Fri Feb 19, 2010 3:42 am

Re: What function of OOP pb can't create

Post by HanPBF »

Yes, modules can fix some modularization concerns...
But the enableexplicit and autocomplete does not work correctly.
At the moment, I don't trust it...

Here is what You get NOT with PB You get with another technic:
- starting Visual Studio -> You get time for making the coffee... and drink it...
- Eclipse -> time for a new PC with more RAM
- RAD Studio -> the good old 80ies/90ies are not yet dead...
- Xojo -> ... sorry, just crashed
- LiveCode -> COBOL was yesterday...

But, I am talking here about a <5 team... (o.k. 1)

So, I am glad PB starts simply which means immediately, F5 starts the compiler and... no, sorry, program yet runs;-)
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5528
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: What function of OOP pb can't create

Post by Kwai chang caine »

- starting Visual Studio -> You get time for making the coffee... and drink it...
:lol: :lol:
Unfortunately..you have so much right
It's when even a pity the MS developpers not see this problem
Everybody on the planet not have a P8 with 22 cores :mrgreen:

Since all this time i wonder, what is also big for need so much time to be loaded :shock: the declaration of human rights, perhaps :mrgreen:
I think, with the OOP and all this library, for sometime create a "hello word !", MS have lost the sense of the reality :|

MS have invented a new concept, because it's more faster to compile a code with PB at the other end of the planet with network, than in the same machine with VS :lol: :lol:

So finally, like if with PB, nothing is impossible
Perhaps one day, one of this super code of the forum friends, can be fulled finish, like COMATE, and at this moment, all members is happy together, the "OOP man", and "Procedural man" 8)

Image

For, thank to this PBI, can use procedural and OOP in the same IDE, like in VC++ 8)
ImageThe happiness is a road...
Not a destination
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: What function of OOP pb can't create ??

Post by IdeasVacuum »

As a less than 10 persons enterprise, the PB team should jump on that train
Not so sure about that - The current VS interface is not that great at all, I use UltraEdit for coding and VS for compiling-debugging. If MS do get the VS editor up to the standard of UltraEdit, then that would be very good.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5528
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: What function of OOP pb can't create ??

Post by Kwai chang caine »

It's incredible this new behavior of MS...
After have take all the dollars of the planet, he give nearly all for nothing.

Perhaps mother theresa is back into a boss of MS :lol:
It's perhaps the turn of LINUX to take money :mrgreen:
ImageThe happiness is a road...
Not a destination
HanPBF
Enthusiast
Enthusiast
Posts: 570
Joined: Fri Feb 19, 2010 3:42 am

Re: What function of OOP pb can't create ??

Post by HanPBF »

Hello!

UltraEdit vs. VisualStudio?

What's Your experience about intellisense/autocomplete?
The SmallTalkers say, testing is the solution for missed typing/intellisense.

Do You write many tests?

I once did put PB compiler to run from EmEditor.
That's seemless; output in EmEditor console; compiling/start -> very easy.

But, only word completion without context is possible; maybe enough(?)

Thanks!
HanPBF
Enthusiast
Enthusiast
Posts: 570
Joined: Fri Feb 19, 2010 3:42 am

Re: What function of OOP pb can't create ??

Post by HanPBF »

Btw. some editors start to use code completion for deined functions; NotePad++ for example.
User avatar
mhs
Enthusiast
Enthusiast
Posts: 101
Joined: Thu Jul 02, 2015 4:53 pm
Location: Germany
Contact:

Re: What function of OOP pb can't create ??

Post by mhs »

what is now the topic of the thread? OOP or the IDE autocomplete / Intellisense functionality?

there's a whole lot of things that PB can not, which one is accustomed from OOP and a programmer's life easier and make the code more structured / understandable. Of course you can also implement all with a huge effort in a pbi, but that makes it not easier to maintain /debug the code.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: What function of OOP pb can't create ??

Post by Danilo »

mhs wrote:what is now the topic of the thread? OOP or the IDE autocomplete / Intellisense functionality?
KCC's question about PB & OOP has already been answered by Han, and KCC is happy with it.
Kwai chang caine wrote:Since several years, i see numerous thread and numerous code talking about OOP. 8)
But nothing really finished :|
In case you missed the Finish:
- Classes in PureBasic
Fred wrote:Not everybody wants OOP, and PB won't have a OOP built-in, it's a design choice and I have made it clear a lot of time on this forum.
If you don't like it, do as Shield did, find a tool which fits your needs better.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5528
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: What function of OOP pb can't create ??

Post by Kwai chang caine »

Yes, danilo have right, in fact i had two questions at the begining

1/ Is it possible to create a full PBI who allow programming the same OOP that .NET (for exampler)

Obviously, i know the PB IDE not create and never modify by FRED for OOP autocompletion, etc... else not also easy that the VS RAD :wink:

But it's perhaps when even possible to coding fully OOP with PB
A little bit like some super MASTER of the web be able to writting a full webpage with notepad :shock: and all works in one shot :shock: :shock:
But just the code, if someone know OOP perfectly, for not need debugging, is it possible to have all the OOP functions with a PBI

Like we have, thanks to SROD, a full OLE PBI for manage the COM object of MS
Here too, using COMATE is much less easy to use with PB, because no autocompletion, no help inside, etc...
But all the function of OLE is in the PBI, and all what VS can do, PB can do too, thanks to COMATE PBI

I hope good explain my question :oops:

2/ If yes (Apparently yes with the answer of Han 8) ) in all the codes already writting on this forum, is it one, who have all the function of OOP, or all the codes are not finish ?
ImageThe happiness is a road...
Not a destination
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

Re: What function of OOP pb can't create ??

Post by heartbone »

If one can't be an effective switch flipper using direct access technology such as assembler/assembly or FORTRAN/BASIC/PL-1,
then after who knows how many levels of oopsy-daisy abstraction are composted into the mix,
what really makes anyone think that programmers could be more effective in that environment?

That was both a real and a rhetorical inquiry.

To address the original topic question.
After the compost is compiled it is transformed into the machine language.
PB is capable of producing functionally similar machine language.
So my answer is that there are none.
Keep it BASIC.
HanPBF
Enthusiast
Enthusiast
Posts: 570
Joined: Fri Feb 19, 2010 3:42 am

Re: What function of OOP pb can't create ??

Post by HanPBF »

Hello KCC,

of course You can programm OOP-like; as You can stack or function or logical like.

You cannot do it with the help of the IDE or the compiler.

; OOP

Code: Select all

procedure replaceStringTheStringByStringStartAtEndAt(MainString.s, TheString.s, ByString.s, StartAt.i=1, EndAt=#PB_Ignore) ; method
  ; this is a method for object string
endprocedure
; for polymorphy You would use a short method name and jump into the part You want to handle (You must use only one base object) and You have no compile type check
; for polymorphy I use @" note the tweo spaces at the beginning" or @" i1234" or @" f123.4"; so I need to use only .i type
; BUT: polymorphy if needed is definitely slower than procedural (and direct) call; that's the joke of procedural programming: it's far faster...

Code: Select all

; SOP - stack oriented programming
global dim Stack(1024) ; 
s("Hello; world!"): s(";"): s(","): replaceStringTheStringByTheString(); o.k. implementation obvious
; LOP - logic oriented programming would use arguments to procedures and write into them (single values and list items)


The point is: even in Assembler You can program in the style You want.

I wonder if some of the tooling, especially intellisense, is maybe worse concerning thinking before "hacking"...
Some years ago, I took a book and the commandline and learned Scala with some little examples.
Very effective...


"what is now the topic of the thread? " -> at least general discussion :wink:

"In case you missed the Finish..." -> :lol:

"OOP" -> only use this word if you are a manager and you want to say something the others think You'd know what you are talking about...
In the programmers world there are types and variables and functions/procedures and dispatch and structures and registers and stacks and lists and... and... classes, ooops...

Have fun programming!
Post Reply