PureBasic maturity

Everything else that doesn't fall into one of the other PB categories.
Mike Trader
User
User
Posts: 43
Joined: Tue Jul 10, 2007 8:09 pm

PureBasic maturity

Post by Mike Trader »

I am taking another look at PureBasic. I got a little distracted with a big project that I began in powerbasic and had to reach a stopping point before translating. I am there.

I wrote a String Builder C++ class that essentially uses a dynamic string (BStr) inside a UDT. Obvioulsy I can manage this myself, but just curious if PureBasic can do this under the hood for me?

Also, how mature/stable is this language now?

I understand it is mostly a procedural language but what is the current thinking on implementing OOP style coding? Is Inheritance possible?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: PureBasic maturity

Post by srod »

Purebasic allows dynamic strings within structures (UDT's) as well as fixed length strings etc. Dynamic strings in Purebasic are not BSTRs, but PureB can work with such strings easily enough. Just remember that, if using BSTRs, it is your reponsibility for freeing these strings because PureB's garbage collector will not automatically free them.

As for OOP... PureB supports interfaces and you can easily knock up basic classes by constructing the vTables yourself. I write all of my software using this methodology now as it is clean and very easy to maintain. There are plenty of examples in these forums for doing this. In terms of the compiler supporting OOP, it has been discussed many many times and, well, the creators of PureB have stated on numerous occasions that they currently have no plans to take that path. Basic inheritance is possible through one interface being able to extend another. All of Powerbasic's interfaces inherit from iUnknown and whilst Purebasic does not insist on that, I find it beneficial to do so simply so that my libraries can be used by Powerbasic developers etc.

As for stability, well you will find that there are frequent updates and, subsequently, you will often find Purebasic to be in beta form. However, even when this occurs (such as now with Purebasic 4.4 being in beta) you will always be able to access the previous release version. Personally, I always work with the very latest versions and I find this language to be very stable, at least in those areas in which I work. Bugs which are reported in these forums are never ignored and many are fixed very quickly indeed.
I may look like a mule, but I'm not a complete ass.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6175
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: PureBasic maturity

Post by blueznl »

I've yet to run into stability problems. (Except my own, that is :-)) Using beta's is a different ballgame...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
harkon
Enthusiast
Enthusiast
Posts: 217
Joined: Wed Nov 23, 2005 5:48 pm

Re: PureBasic maturity

Post by harkon »

Hey Mike, good to see you here from the PowerBasic group. Welcome :)

Srod is definitely the OOP specialist around here. He has posted some really good info on his website. I think you'll find that for most anything that needs doing, if the language doesn't provide a solution directly, someone has figured a way to do it yourself.

Hope you are here for the duration.
Missed it by that much!!
HK
Mike Trader
User
User
Posts: 43
Joined: Tue Jul 10, 2007 8:09 pm

Re: PureBasic maturity

Post by Mike Trader »

Thank you. It would be a VERY refreshing change to post in a forum where the moderator is a little more willing to deal with criticism and defend design decsions rather than deleting threads and banning members ala powerbasic forum.

I am interested in the UDT members. It seems that to address a member the / is used rather then the .

so a UDT with a member a would be assigned as SomeUDT/a = 42 rather than SomeUDT.a = 42?
Thorium
Addict
Addict
Posts: 1314
Joined: Sat Aug 15, 2009 6:59 pm

Re: PureBasic maturity

Post by Thorium »

Mike Trader wrote: so a UDT with a member a would be assigned as SomeUDT/a = 42 rather than SomeUDT.a = 42?
It's a backslash:

Code: Select all

SomeUDT\a = 42
A dot is declaring the type of a variable in PureBasic.

Code: Select all

Define LongVariable.l
Last edited by Thorium on Sun Sep 13, 2009 8:58 pm, edited 1 time in total.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: PureBasic maturity

Post by ts-soft »

> so a UDT with a member a would be assigned as SomeUDT/a = 42 rather than SomeUDT.a = 42?
A Backslash \, not a Slash :wink:
You're right.

// edit
Thorium is faster :x
Mike Trader
User
User
Posts: 43
Joined: Tue Jul 10, 2007 8:09 pm

Re: PureBasic maturity

Post by Mike Trader »

Would there be some clever way to switch those perhaps because all my udts use the dot to specify members ala powerbasic. I can do a find/replace but I am wondering if there is a compiler trick or macro or something that might make it less work to convert the code?
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Re: PureBasic maturity

Post by Fluid Byte »

I am wondering if there is a compiler trick or macro or something that might make it less work to convert the code?
Nope. New language, new rules. :wink:
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Post Reply