Classes in PureBasic

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

Re: Classes in PureBasic

Post by heartbone »

Danilo wrote:Very ancient, old-fashioned opinion, heartbone
Thanks. :D
.
Danilo wrote:I doubt they can implement OOP within 2 hours, so after getting Fred's opinion changed,
it would probably be more expensive.
I think that you are correct.
A kickstarter or something similar would help to share the price. Set a goal (5,000 or 10,000 Euro or whatever it would cost),
and if the goal is reached, it gets implemented properly. Only Fantaisie Software could do that for their product.
Therein lies the rub.
Do you even have the beginnings of a proper functional specification?
Good luck with that one buddy.
Before thinking about those possibility, Fred has to change his opinion. As long as he resists, it will not get implemented internally,
so your only option is to use a pre-processor or compiler that translates OOP syntax to procedural PB.
Translates OOP syntax to PB????
Just curious, why?
Because that seems insane.
Why not to machine code?
It seems to be getting more weird with the abundance of minds made worthless for use in normal (procedural) programming after being corrupted by OO programming, infesting a B.A.S.I.C. programmer forum with their frustrated pleas.
The good thing is that some of the responses, thank you luis, are entertaining.
Carry on.
c4s wrote:Slightly offtopic:
DK_PETER wrote:From what I've seen so far, only a VERY small number of users actually produces any kind of revenue using PureBasic.
The silent majority are most likely hobbyists (like me. Ordinary wageslaves - doing freeware only), newbies and wannabees/(dreamers).
I'd say most of the users simply don't brag about it (why should they?) because the results from the PureBasic Poll I initiated back in 2012 suggest something different. In fact of the participants about 40% had a professional intention (commercial and/or company internal) when using PureBasic, besides the appealing hobby/private programming.

But since then PureBasic has matured a lot. Maybe the results are simply outdated so that it's time for another poll. If someone is interested in the raw material to create a new one I'd be happy to help (unfortunately I don't have time for that otherwise I'd love to do it myself).
Thanks for creating and sharing that poll c4s.
Keep it BASIC.
User avatar
Olliv
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Sep 22, 2009 10:41 pm

Re: Classes in PureBasic

Post by Olliv »

I do not understand all the sentences in this subject.
I think OOP is a syntax and PureBasic compiler does not miss lots of directives to get this availability.

I insist about the fact oop is a syntax. Cpu is procedural. If the hardware is procedural: two ways are available in order to make a compiler
1) stay procedural and then convert oop to procedural
2) convert natively Oop to procedural

It is a very good choice have stayed procedural. Now there is modules. It is a "new" concept. But it is not to make OOP code, but to grow procedural concept.

OOP has two characteristics.
1) Syntax
2) Memory access

Syntax is "near" available (without talking about modules).
How many memory access mode are available on OOP?

I think it is the real question which would get answers.
How to structure different links between oop components? Does it exist a standard? How many exceptions?

Let's note if Fred did the choice to make an oop compiler, these questions were unable to ask and the answers were non-sense.
User_Russian
Addict
Addict
Posts: 1518
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Classes in PureBasic

Post by User_Russian »

All of this controversy, but now really can not, by simple means, to implement polymorphism in PB. OOP solves this problem.
In OOP, a lot of benefits and really want to Fred added it to PB.
User avatar
Olliv
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Sep 22, 2009 10:41 pm

Re: Classes in PureBasic

Post by Olliv »

Not sure. It is important to be explicit in the call of a method.
If this detail is bypassed in the name of the method, could we say it is a solution? We can note others compilers use this same solution in different standards (because this solution solves a larger set of directives using).

My own wall is the difference of variables types between compilers, obviously the fact of PureBasic does not consider natively booleans, fix-limited strings and voids types.
User avatar
skywalk
Addict
Addict
Posts: 4210
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Classes in PureBasic

Post by skywalk »

Olliv wrote:My own wall is the difference of variables types between compilers, obviously the fact of PureBasic does not consider natively booleans, fix-limited strings and voids types.
:?:
Boolean = 1 Byte = Define myboolean.b
Fixed length strings = 2 Bytes/char = Define myfixedstr.s{2}
Voids are pointers to nothing? So we can have them too.
PB does not have:
Unsigned Long = 4 Bytes, 0 to 4294967295
Long Double = 10 Bytes, -3.4e-4932 to 1.1e+4932
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Olliv
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Sep 22, 2009 10:41 pm

Re: Classes in PureBasic

Post by Olliv »

skywalk wrote: Define myfixedstr.s{2}
This recall is a very useful solution to solve types compatibility questions. I fully forgot it.
User avatar
Olliv
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Sep 22, 2009 10:41 pm

Re: Classes in PureBasic

Post by Olliv »

skywalk wrote:Unsigned Long = 4 Bytes, 0 to 4294967295
Does not the CPU calculate such these variables? Are the integer divisions unable to execute a signed long as an unsigned long?

For the 10-bytes floats, I am a few surprised because FPU support them long time ago.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Classes in PureBasic

Post by Danilo »

heartbone wrote:
so your only option is to use a pre-processor or compiler that translates OOP syntax to procedural PB.
Translates OOP syntax to PB????
Just curious, why?
Because that seems insane.
Why not to machine code?
Because it integrates nicely with PB. It's just an extension on top of PB.

For example, I use some macros to make the work with Interfaces easier for me.
It supports inheritance, constructors, destructors, method overriding.
The constructors and destructors are called in proper way for the inheritance hierarchy.
An example "Class"/Interface looks like this:

Code: Select all

;------- SMALL EXAMPLE ---------


;- Class Window
;{ Class Window
Interface Window Extends Object
    Show()
    Hide()
    Close()

    GetWidth.l()
    GetHeight.l()
EndInterface

Structure sWindow Extends sObject
    Window_Num.i
EndStructure

Method(Window,destroy)(*this.sWindow)
    Dbg("Window::destroy()")
    If *this\Window_Num
        CloseWindow(*this\Window_Num)
    EndIf
    _Object_Destroy(*this)
EndMethod()

Method(Window,Show)(*this.sWindow)
    If *this\Window_Num
        HideWindow(*this\Window_Num,#False)
    EndIf
EndMethod()

Method(Window,Hide)(*this.sWindow)
    If *this\Window_Num
        HideWindow(*this\Window_Num,#True)
    EndIf
EndMethod()

Method(Window,Close)(*this.sWindow)
    If *this\Window_Num
        CloseWindow(*this\Window_Num)
        *this\Window_Num = 0
    EndIf
EndMethod()

Method(Window,GetWidth,.l)(*this.sWindow)
    If *this\Window_Num
        ProcedureReturn WindowWidth(*this\Window_Num)
    EndIf
EndMethod()

Method(Window,GetHeight,.l)(*this.sWindow)
    If *this\Window_Num
        ProcedureReturn WindowHeight(*this\Window_Num)
    EndIf
EndMethod()

Procedure.i New_Window(x,y,width,height,title$, flags=-1)
    InitInterface(Window,Object)

    Override(Window,destroy)

    AddMethod(Window,Show)
    AddMethod(Window,Hide)
    AddMethod(Window,Close)

    AddMethod(Window,GetWidth)
    AddMethod(Window,GetHeight)

    CHECKINTERFACE(Window)
    
    If flags = -1
        flags = #PB_Window_TitleBar|#PB_Window_SystemMenu
    EndIf
    
    *ptr\Window_Num = OpenWindow(#PB_Any,x,y,width,height,title$,flags)
    
    ProcedureReturn *ptr
EndProcedure
;}



win1.Window = New( Window(100,100,800,600,"Title") )

Debug win1\GetWidth()
Debug win1\GetHeight()

Repeat:Until WaitWindowEvent()=#PB_Event_CloseWindow

Delete( win1 )
It helps me to make this little bit more readable and structured to prevent errors. The macros have also checks if Debugger is enabled,
so I don't forget to add a method etc.

With my small pre-processor hack, I can do it even more simple and structured. Just some excerpt:

Code: Select all

UseClass(GadgetBase)

Class ButtonGadget Extends GadgetBase
    Public Method Constructor(x=0, y=0, width=0, height=0, text.s="", flags=0)
        me\SetPosition(x,y)
        me\SetSize(width,height)
        me\SetText(text)
        me\SetFlags(flags)
    EndMethod
    
    Override Public Method __create()
        me\Close()
        me\_pb_object = ButtonGadget(#PB_Any,me\GetX(),me\GetY(),me\GetWidth(),me\GetHeight(),me\GetText(),me\GetFlags())
        me\__init()
    EndMethod
EndClass

Code: Select all

UseClass(GadgetBase)

Class CanvasGadget Extends GadgetBase
    Public Method Constructor(x=0, y=0, width=0, height=0, flags=0)
        me\SetPosition(x,y)
        me\SetSize(width,height)
        me\SetFlags(flags)
    EndMethod
    
    Override Public Method __create()
        me\Close()
        me\_pb_object = CanvasGadget(#PB_Any,me\GetX(),me\GetY(),me\GetWidth(),me\GetHeight(),me\GetFlags())
        me\__init()
    EndMethod
    
    Public Method Output()
        If me\_pb_object
            ProcedureReturn CanvasOutput(me\_pb_object)
        EndIf
    EndMethod
    
    
    Public Method OnMouseEnter(*function.__EM_ProcessEvent__)
        OOP_GadgetEvents( Str(me) + ":-1")\Event_MouseEnter = *function
    EndMethod
    Public Method OnMouseLeave(*function.__EM_ProcessEvent__)
        OOP_GadgetEvents( Str(me) + ":-1")\Event_MouseLeave = *function
    EndMethod
    Public Method OnMouseMove(*function.__EM_ProcessEvent__)
        OOP_GadgetEvents( Str(me) + ":-1")\Event_MouseMove = *function
    EndMethod
    Public Method OnMouseWheel(*function.__EM_ProcessEvent__)
        OOP_GadgetEvents( Str(me) + ":-1")\Event_MouseWheel = *function
    EndMethod
    Public Method OnLeftButtonDown(*function.__EM_ProcessEvent__)
        OOP_GadgetEvents( Str(me) + ":-1")\Event_LeftButtonDown = *function
    EndMethod
    Public Method OnLeftButtonUp(*function.__EM_ProcessEvent__)
        OOP_GadgetEvents( Str(me) + ":-1")\Event_LeftButtonUp = *function
    EndMethod
    Public Method OnRightButtonDown(*function.__EM_ProcessEvent__)
        OOP_GadgetEvents( Str(me) + ":-1")\Event_RightButtonDown = *function
    EndMethod
    Public Method OnRightButtonUp(*function.__EM_ProcessEvent__)
        OOP_GadgetEvents( Str(me) + ":-1")\Event_RightButtonUp = *function
    EndMethod
    Public Method OnMiddleButtonDown(*function.__EM_ProcessEvent__)
        OOP_GadgetEvents( Str(me) + ":-1")\Event_MiddleButtonDown = *function
    EndMethod
    Public Method OnMiddleButtonUp(*function.__EM_ProcessEvent__)
        OOP_GadgetEvents( Str(me) + ":-1")\Event_MiddleButtonUp = *function
    EndMethod
    Public Method OnKeyDown(*function.__EM_ProcessEvent__)
        OOP_GadgetEvents( Str(me) + ":-1")\Event_KeyDown = *function
    EndMethod
    Public Method OnKeyUp(*function.__EM_ProcessEvent__)
        OOP_GadgetEvents( Str(me) + ":-1")\Event_KeyUp = *function
    EndMethod
    Public Method OnInput(*function.__EM_ProcessEvent__)
        OOP_GadgetEvents( Str(me) + ":-1")\Event_Input = *function
    EndMethod
    
EndClass

Code: Select all

UseClass(GadgetBase)

Class ItemStateGadget Extends GadgetBase
    Public Method.i GetItemState(item)
        If me\_pb_object
            ProcedureReturn GetGadgetItemState(me\_pb_object, item)
        EndIf
    EndMethod
    Public Method SetItemState(item, state)
        If me\_pb_object
            SetGadgetItemState(me\_pb_object, item, state)
        EndIf
    EndMethod
EndClass

Class ItemGadget Extends GadgetBase
    Public Method.i ItemID(item)
        If me\_pb_object
            ProcedureReturn GadgetItemID(me\_pb_object, item)
        EndIf
    EndMethod
    
    Public Method AddItem(position, text.s, imageID=0, flags=0)
        If me\_pb_object
            AddGadgetItem(me\_pb_object, position, text.s, imageID, flags)
        EndIf
    EndMethod
    
    Public Method RemoveItem(position)
        If me\_pb_object
            RemoveGadgetItem(me\_pb_object, position)
        EndIf
    EndMethod
    
    Public Method ClearItems()
        If me\_pb_object
            ClearGadgetItems(me\_pb_object)
        EndIf
    EndMethod
    
    Public Method.i CountItems()
        If me\_pb_object
            ProcedureReturn CountGadgetItems(me\_pb_object)
        EndIf
    EndMethod
    
    Public Method SetItemText(item, text.s, column=0)
        If me\_pb_object
            SetGadgetItemText(me\_pb_object, item, text, column)
        EndIf
    EndMethod
    
    Public Method.s GetItemText(item, column=0)
        If me\_pb_object
            ProcedureReturn GetGadgetItemText(me\_pb_object, item, column)
        EndIf
    EndMethod

    [...]

Code: Select all

Class GadgetBase
    _pb_object.i
    
    _tooltip.s
    Map _x.i()
    Map _y.i()
    _width.i
    _height.i
    _flags.i
    _text.s
    _state.i
    _fontID.i
    Map _data.i()
    Map _attributes.i()
    Map _colors.i()
    
    _disabled.i
    _hidden.i
    
    Public Method Constructor()
            me\_fontID = #PB_Default ; -1 on Windows
    EndMethod
    
    Public Method.i ID()
        If me\_pb_object
            ProcedureReturn GadgetID(me\_pb_object)
        EndIf
    EndMethod
    
    Public Method.i Gadget()
        ProcedureReturn me\_pb_object
    EndMethod
    
    
    Public Method.i Type()
        If me\_pb_object
            ProcedureReturn GadgetType(me\_pb_object)
        EndIf
    EndMethod

    Public Method.i IsGadget()
        If me\_pb_object
            ProcedureReturn IsGadget(me\_pb_object)
        EndIf
    EndMethod
    
    Public Method Free()
        If me\_pb_object
            FreeGadget(me\_pb_object)
            me\_pb_object = 0
        EndIf
    EndMethod
    
    Public Method Close()
        me\Free()
    EndMethod
    
    Public Method Disable(state=1)
        me\_disabled = state
        If me\_pb_object
            DisableGadget(me\_pb_object, state)
        EndIf
    EndMethod
    
    Public Method Enable(state=1)
        state!1
        me\_disabled = state
        If me\_pb_object
            DisableGadget(me\_pb_object,state)
        EndIf
    EndMethod
    
    Public Method Hide(state=1)
        me\_hidden = state
        If me\_pb_object
            HideGadget(me\_pb_object, state)
        EndIf
    EndMethod
    
    Public Method Show(state=1)
        state!1
        me\_hidden = state
        If me\_pb_object
            HideGadget(me\_pb_object, state)
        EndIf
    EndMethod
    
    Public Method Resize(x,y,width,height)
        me\_x(Str(#PB_Gadget_ContainerCoordinate)) = x
        me\_y(Str(#PB_Gadget_ContainerCoordinate)) = y
        me\_width  = width
        me\_height = height
        If me\_pb_object
            ResizeGadget(me\_pb_object,x,y,width,height)
        EndIf
    EndMethod
    
    Public Method Activate()
        If me\_pb_object
            SetActiveGadget(me\_pb_object)
        EndIf
    EndMethod
    
    Public Method.i IsActivated()
        If me\_pb_object
            If GetActiveGadget() = me\_pb_object
                ProcedureReturn #True
            EndIf
        EndIf
        ProcedureReturn #False
    EndMethod
    
    Public Method.i GetWidth()
        If me\_pb_object
            me\_width = GadgetWidth(me\_pb_object)
        EndIf
        ProcedureReturn me\_width
    EndMethod
    
    Public Method SetWidth(width)
        me\_width  = width
        If me\_pb_object
            ResizeGadget(me\_pb_object,#PB_Ignore,#PB_Ignore,width,#PB_Ignore)
        EndIf
    EndMethod

    Public Method.i GetHeight()
        If me\_pb_object
            me\_height = GadgetHeight(me\_pb_object)
        EndIf
        ProcedureReturn me\_height
    EndMethod
    
    Public Method SetHeight(height)
        me\_height = height
        If me\_pb_object
            ResizeGadget(me\_pb_object,#PB_Ignore,#PB_Ignore,#PB_Ignore,height)
        EndIf
    EndMethod
    
    Public Method GetX(flags=#PB_Gadget_ContainerCoordinate)
        If me\_pb_object
            me\_x(Str(flags)) = GadgetX(me\_pb_object,flags)
        EndIf
        ProcedureReturn me\_x(Str(flags))
    EndMethod
    
    Public Method SetX(x)
        me\_x(Str(#PB_Gadget_ContainerCoordinate)) = x
        If me\_pb_object
            ResizeGadget(me\_pb_object,x,#PB_Ignore,#PB_Ignore,#PB_Ignore)
        EndIf
    EndMethod
    
    Public Method GetY(flags=#PB_Gadget_ContainerCoordinate)
        If me\_pb_object
            me\_y(Str(flags)) = GadgetY(me\_pb_object,flags)
        EndIf
        ProcedureReturn me\_y(Str(flags))
    EndMethod
    
    Public Method SetY(y)
        me\_y(Str(#PB_Gadget_ContainerCoordinate)) = y
        If me\_pb_object
            ResizeGadget(me\_pb_object,#PB_Ignore,y,#PB_Ignore,#PB_Ignore)
        EndIf
    EndMethod
    
    Public Method SetSize(width,height)
        me\_width  = width
        me\_height = height
        If me\_pb_object
            ResizeGadget(me\_pb_object,#PB_Ignore,#PB_Ignore,width,height)
        EndIf
    EndMethod
    
    Public Method SetPosition(x,y)
        me\_x(Str(#PB_Gadget_ContainerCoordinate)) = x
        me\_y(Str(#PB_Gadget_ContainerCoordinate)) = y
        If me\_pb_object
            ResizeGadget(me\_pb_object,x,y,#PB_Ignore,#PB_Ignore)
        EndIf
    EndMethod
    
    Public Method.s GetText()
        If me\_pb_object
            me\_text = GetGadgetText(me\_pb_object)
        EndIf
        ProcedureReturn me\_text
    EndMethod
    
    Public Method SetText(text.s)
        me\_text = text
        If me\_pb_object
            SetGadgetText(me\_pb_object, text)
        EndIf
    EndMethod
    
    Public Method.i GetState()
        If me\_pb_object
            me\_state = GetGadgetState(me\_pb_object)
        EndIf
        ProcedureReturn me\_state
    EndMethod
    
    Public Method SetState(state)
        me\_state = state
        If me\_pb_object
            SetGadgetState(me\_pb_object, state)
        EndIf
    EndMethod
    
    Public Method.i GetFlags()
        ProcedureReturn me\_flags
    EndMethod
    
    Public Method SetFlags(flags)
        me\_flags = flags ; re-create on flag change?
        ;If me\_pb_object
        ;    ; re-create the gadget
        ;EndIf
    EndMethod
    
    
    Public Method.i GetData(index=0)
        ;If me\_pb_object
        ;    ProcedureReturn GetGadgetData(me\_pb_object)
        ;EndIf
        ProcedureReturn me\_data(Str(index))
    EndMethod
    
    Public Method SetData(value, index=0)
        ;If me\_pb_object
        ;    SetGadgetData(me\_pb_object, value)
        ;EndIf
        me\_data(Str(index)) = value
    EndMethod
    
    Public Method.i GetAttribute(attribute)
        If me\_pb_object
            me\_attributes(Str(attribute)) = GetGadgetAttribute(me\_pb_object, attribute)
        EndIf
        ProcedureReturn me\_attributes(Str(attribute))
    EndMethod
    
    Public Method SetAttribute(attribute, value)
        me\_attributes(Str(attribute)) = value
        If me\_pb_object
            SetGadgetAttribute(me\_pb_object, attribute, value)
        EndIf
    EndMethod
    
    Public Method.i GetFont()
        If me\_pb_object
            me\_fontID = GetGadgetFont(me\_pb_object)
        EndIf
        ProcedureReturn me\_fontID
    EndMethod
    
    Public Method SetFont(fontID)
        me\_fontID = fontID
        If me\_pb_object
            SetGadgetFont(me\_pb_object, fontID)
        EndIf
    EndMethod
    
    Public Method.s GetTooltip()
        ProcedureReturn me\_tooltip
    EndMethod
    
    Public Method SetTooltip(text.s)
        me\_tooltip = text
        If me\_pb_object
            GadgetToolTip(me\_pb_object, text)
        EndIf
    EndMethod
    
    Public Method.i GetColor(colorType)
        ;If me\_pb_object
        ;    me\_colors(Str(colorType)) = GetGadgetColor(me\_pb_object, colorType)
        ;EndIf
        ProcedureReturn me\_colors(Str(colorType))
    EndMethod
    
    Public Method SetColor(colorType, color)
        me\_colors(Str(colorType)) = color
        If me\_pb_object
            SetGadgetColor(me\_pb_object, colorType, color)
        EndIf
    EndMethod
    
    [...]
It is just an old example. Nonetheless, in my opinion, a large Framework is much more easier to manage this way. Other brains may think different. ;)
User avatar
luis
Addict
Addict
Posts: 3893
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Classes in PureBasic

Post by luis »

To all people using a preprocessor, how did you solve the problem of making the PB compiler to report errors relative to your source (the one to be processed) instead of the final PB source ?
Other languages have specific compiler directives which help there (for example http://msdn.microsoft.com/en-us/library/b5w2czay.aspx).

Also there are other problems, for example using the debugger you actually debug the generated target source, not the one you wrote using the preprocessor... those are just a few of the reasons why I find it really cumbersome.
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Classes in PureBasic

Post by Danilo »

luis wrote:To all people using a preprocessor, how did you solve the problem of making the PB compiler to report errors relative to your source (the one to be processed) instead of the final PB source ?
Other languages have specific compiler directives which help there (for example http://msdn.microsoft.com/en-us/library/b5w2czay.aspx).
I haven't solved it yet, so I get errors with wrong line numbers. Very annoying, and I miss the C #line directive. :)

I had some thoughts about it already. One thing is to map the lines 1:1, using the ':' statement divider.
Unfortunately the 1:1 mapping is not always possible. So my final idea was to use a macro on every line.

Code: Select all

Macro Line(_lineNumber_):EndMacro

Line(124): ;
Line(125): ; generated code here
Line(126): ;
So after getting PB's line error, you have to re-scan the generated source again to get the correct line
within the generated pseudo-sourcecode.

I don't use PB's Debugger except for 'Debug "Output Something"', so this would be another problem.

The final thing is to convert my small pre-processor hack (just 500 lines of code) to a real PB pre-processor,
including a better cross-platform IDE that has support for all that, including a proper Visual Form Designer.
It is like re-writing the PB compiler. Do-able, but just a bunch of boring month. I have some things in mind
about this thought:
1.) Why create a full PB Compiler myself? Wouldn't it be better to write my own product instead?

And lately I have the thought:
2.) BlitzMax has all that OOP stuff already, why not move? It translates to ASM and utilizes MinGW, so even something like

Code: Select all

Import "myLib.cpp"
is possible with this BASIC dialect, not talking about the C++ compiler optimizations. It provides same platforms as PB (Win, Linux, Mac),
and Brucey has all this libs at code.google.com/p/maxmods, including wxMax (wxWidgets Include).
Great language, but the IDE and help file for this other product suxx big time compared to PB. It's only useable with 3rd Party IDE's like Blide (unfortanetely Windows only).

Just struggling with myself...
Last edited by Danilo on Sun Nov 16, 2014 5:07 am, edited 3 times in total.
User avatar
Olliv
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Sep 22, 2009 10:41 pm

Re: Classes in PureBasic

Post by Olliv »

Danilo wrote:So my final idea was to use a
macro on every line.
That is reason I suggest a "free section" which is managed near like a datasection.
It is not an emergency because file managing allows this option indirectly.

This technic is more easily manageable for the errors than using macros.

I note there is two main ways in PureBasic to stand up oop: with or without interfaces.

Personnally, I prefer the second one. But the reason is I ignore the first one. So this preference is just mine... What is important is know we are free to choice!
User avatar
luis
Addict
Addict
Posts: 3893
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Classes in PureBasic

Post by luis »

@Danilo

Thank you, the empty macro is a nice idea. Still cumbersome but I suppose is the best we can do with what we have at the moment.

About the rest, I have to mostly agree.

But all this is a problem (for us) only if you have unrealistic expectations (considering comments from Fred on specific points and the compiler in general) or if you buried yourself in PB too much without being objective (actually needing something else).
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
skywalk
Addict
Addict
Posts: 4210
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Classes in PureBasic

Post by skywalk »

Danilo wrote:Sometimes feels like it's the end of the good, powerful, PureBasic days
Oh no Danilo. You are about to be added to The PureBasic Doomsday Quotes :D
Danilo wrote:PureBasic, it's just a blink of a second within the great universe...
All programming as we know it, is also soon to fade. I am no fan of typing my crazy, disorderly thoughts into a keyboard and IDE and having to conform to a particular structure or syntax. Knowledge is fluid and so will our modern computing methods become.

Think of programming languages(or even spoken ones) as a religion. They are binding and isolating. As religions fade, we focus more on tangible issues and their solutions. Not on dogma or tools.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Golfy
User
User
Posts: 97
Joined: Wed Mar 21, 2012 6:10 pm

Re: Classes in PureBasic

Post by Golfy »

IMHO, Fred and other Purebasic creators can't make purebasic OOP because it will take them too much time for so low benefits !
They've a life (maybe married, childrens, dogs or cats... and a real job).

I really want OOP possible too (because Purebasic team have make some concepts very easy too use, like structure, linkedlist, form & event) but honestly, they have to win some money (enough to stop their jobs) !!!

:|
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Classes in PureBasic

Post by Danilo »

skywalk wrote:
Danilo wrote:Sometimes feels like it's the end of the good, powerful, PureBasic days
Oh no Danilo. You are about to be added to The PureBasic Doomsday Quotes :D
I guess I'm just struggling/fighting with myself, and it results in procrastination of many ideas. Sorry for the disruption.
Post Reply