Page 1 of 2

PureBasic Love hate relationship

Posted: Mon Dec 26, 2005 9:39 pm
by kake26
Hi all,
I've always debated which is better PureBasic or FPC(Free Pascal). I mean PureBasic is a good lang and cross platform. Even with 3.94 I've seen more functionality ported to Linux under PB. It still can't make Linux libs though and thats a bit annoying. Then I'm faced with which do I use since PB is a great lang, but FPC is has more units and things for such as zlib,mysql,pgsql. Granted ODBC works and can be used under Linux/Unix via UnixODBC. PureBasic also seems to play better with C code than FPC usually. However there is allot of stuff that FPC can do that PB can't, unless you write the code needed to do it by hand. I've written a interprerter in PB already and to me that says alot of good things about PB. However I've decided to create another one and tried it in PB and have found it to not be so easy as it would be with FPC. Bottom line I'm stuck in a love hate relationship with PB and its driving me nuts. There are days where I hide in the PB IDE and others when I hide in a console window coding FPC. It bothers me that I can't make up my mind. Consider this the irrelvant thought for the day.

Posted: Mon Dec 26, 2005 11:04 pm
by josku_x
It is simple, if you think FPC has something that PB doesn't, you could ask here and maybe you get an answer and then continue working with PB unless FPC crashes your mind again.

It's like mixing oil with water, you can after that extract the oil and have the water without oil :D

Posted: Mon Dec 26, 2005 11:30 pm
by PB
PureBasic v4.00 should put your mind at ease. ;)

Posted: Mon Dec 26, 2005 11:51 pm
by kake26
wooohoo! I look forward to it. 3.94 was a big improvment over previous version so I have high hopes.

Posted: Mon Dec 26, 2005 11:59 pm
by kake26
PB isn't OOP hehe OLD SCHOOL so OLD SCHOOL. I like OLD school though.

Posted: Tue Dec 27, 2005 12:03 am
by kake26
Pound for Pound FPC is superior to PB in the end. PB will evelove nicely though, but it has much a way to go. I'll still use it cause I mean I bought it so to not use it would be a waste.

Re: PureBasic Love hate relationship

Posted: Tue Dec 27, 2005 12:16 am
by PB
> there is allot of stuff that FPC can do that PB can't, unless you write the code needed to do it by hand

In other words, PureBasic can do what FPC does. ;)

Posted: Tue Dec 27, 2005 6:48 am
by kake26
well only half way since PB can't do any OOP stuff.

Posted: Tue Dec 27, 2005 9:47 am
by blueznl
... which is great :-)

Posted: Tue Dec 27, 2005 12:39 pm
by Berikco
yes, no oop, great :)

Posted: Tue Dec 27, 2005 1:17 pm
by thefool
Berikco wrote:yes, no oop, great :)
no thats bad! :D

Posted: Tue Dec 27, 2005 4:29 pm
by kake26
I'm gonna agree with thefool that is bad. Now I realize I'm crazy, but still I say I'm allowed to be a bit over the top. I used to hate OOP myself and the I discovered some of its very unique advantages, like class inheritiance and I was hooked I got over the initial eww its bad. Its infact a good thing, a very good thing. Please note this will not stop or discourage me from using PureBasic at all, but has been things for me toconsider when starting a new project. To each his own I suppose.

Posted: Tue Dec 27, 2005 7:52 pm
by josku_x
you are wrong!

PB can do OOP look in the CodeArchiv, there are examples on using OOP with PB.

You can do Object(0)\Move(x, y) I'm sure about it!

:? Or am I sure? :lol:

EDIT:

Code: Select all

; PureBasic Chat
; Author: Danilo (updated for PB3.93 by ts-soft)
; Date: 10. January 2004


;- CLASS cTEST  start
  ; cTest CLASS Interface
  Interface cTEST
    Procedure1.l()
    Procedure2.f(String$)
  EndInterface

  ; cTest CLASS Object
  Structure cTEST_OBJ
    VTable.l
    Functions.l[SizeOf(cTEST)/4]
  EndStructure

  Procedure.l cTEST__Procedure1(*this.cTEST)
    MessageRequester("INFO","Procedure 1 in cTEST")
    ProcedureReturn 12
  EndProcedure

  Procedure.f cTEST__Procedure2(*this.cTEST, String$)
    MessageRequester("INFO",String$)
    ProcedureReturn 123.456
  EndProcedure

  ; cTEST CLASS Constructor
  Procedure cTEST()
    ; Function table
    *object.cTEST_OBJ = AllocateMemory(SizeOf(cTEST_OBJ))
    If *object=0: ProcedureReturn 0: EndIf ; memory allocation failed

    *object\VTable  = *object+OffsetOf(cTEST_OBJ\Functions)
    *object\Functions[0] = @cTEST__Procedure1()
    *object\Functions[1] = @cTEST__Procedure2()
    ProcedureReturn *object
  EndProcedure


;- Program Start
*obj1.cTEST = cTEST()
If *obj1
  Debug *obj1\Procedure1()
  Debug *obj1\Procedure2("Hello World !")
EndIf
Well? day-dreamers, it's time to wake up!

Posted: Tue Dec 27, 2005 8:01 pm
by thefool
Like we didnt know ;)
But that doesnt make pb an oop language.. Do some research!

first of all, it would need to have easy access to do such stuff.

Posted: Wed Jan 04, 2006 10:08 am
by josku_x
I understand such as: Window\Close(hWnd)
or like Object\Create(hObj)

without declaring so much things..
Maybe there is already a good language like PB that does that?

VB?