- snipped -
Post by Marc van BreemenI do now PureBasic and looked at it shortly. At first sight it looks good
(small IDE, small EXE's) and can be compared with PowerBasic to some
extend. I'm however not (yet) convinced that it's of equal quality and it
worries me if they will stay in operation. They ask a one-time price which
is very low (79 euro) and don't charge for updates. How will they survive
long with that policy, or maybe this is and will be a hobby project and
they have a 'normal' daytime job.
I'm not saying that PureBasic is out of my mind yet. Maybe you can
convince me. F.e. by giving me a PureBasic code translating of the VB.NET
code I just posted on the PB forum (under 'PowerBASIC for Windows').
Marc,
Your concern regarding the overall longevity of the product does have some
merit, however, it is currently being actively developed and I don't think
the developers are going anywhere any time soon. PureBasic has been
marketed since late 2000. The reason I moved to PureBasic is because VB6
was discontinued. This fact illustrates that compilers and languages have
no long term guarantee. I personally can't see any reason, beyond a few
small company policies, why anyone would not want to purchase PowerBasic
from a purely technical standpoint. It is truly a fine product. Personally,
paying for every upgrade and every add-on, for me is a deal breaker. If you
plan to make a lot of money developing with it, then you may be able to
justify it. For me, and this is just for me personally, and for the time
being, I get way more for my money with PureBasic. Again, that's just for
me personally.
BTW, PureBasic does perform much faster compiling and then running the exe
outside of the IDE than just running from inside the IDE. This is different
than PowerBasic where the two run pretty much the same speed. The reason, I
assume, is due to the inclusion of the debugger in the IDE run code.
For me a real plus to PureBasic is the community forums. There's a great
deal of help there, and there are a large number of libraries available as
well. You also have the option to build your own libraries for inclusion in
other projects. Built-in native support for SQLite and OBDC, and a number
if different graphics format makes things a bit easier as well. I can
honestly tell you that to this point, whatever I needed to do that wasn't
already built-in, I found a way to build it myself, or found someone else I
could borrow code or a library from.
When you ported your .NET code to PureBasic you illustrated the slow string
handling that PureBasic has. This isn't really a bad thing as once you know
that building a string using "a'+"b"+"c" is a really slow way to do this. I
learned that in VB6. Creating a static string and manipulating it's
contents is always faster. I will say this though, PowerBasic does dynamic
strings really quickly.
Anyway, here's your PureBasic code somewhat modified. On my modest machine
it takes about 19500mS when run from inside the IDE, and about 6850mS from
a standalone exe. I did find a faster way and that was to convert the
string "ab" to a word $6261 and PokeW() the word to the right string
address. This did run faster, about 1000mS on my machine) but is not really
in keeping with handling strings. This version very cl.osely emmulates the
version posted by John Gleason on the PB formum.
;- ********* Start PureBasic code *********
; everything with a ";" in front of it is remarked out
; and will not execute
EnableExplicit
Define strString.s
Define dblDouble.d
Define intIndex.i
Define intString.i
Define intDouble.i
Define StartTime.i
Define ElapsedTime.i
Define ab$
Define de$
;- **** This is the slow way ****
; StartTime = ElapsedMilliseconds()
;
;
; For intIndex = 0 To 100000
;
; strString = ""
; For intString = 0 To 200
; strString = "ab" + strString + "de"
; Next intString
; strString = ReplaceString(strString, "ab", "123")
;
; dblDouble = 9876.54321
; For intDouble = 0 To 1000
; dblDouble = dblDouble * dblDouble
; dblDouble = dblDouble / ((dblDouble + 100) / 2)
; Next intDouble
; Next
;- **** This is a faster way ****
StartTime = ElapsedMilliseconds()
ab$="ab"
de$="de"
For intIndex = 0 To 100000
strString=Space(4*201)
For intString = 0 To 200
CopyMemory(@ab$,@strString + (2*201) - (2*intString) -1,2)
CopyMemory(@de$,@strString + (2*201) + (2*intString) +1,2)
Next intString
strString = ReplaceString(strString, "ab", "123")
dblDouble = 9876.54321
For intDouble = 0 To 1000
dblDouble = dblDouble * dblDouble
dblDouble = dblDouble / ((dblDouble + 100) / 2)
Next intDouble
Next
ElapsedTime = ElapsedMilliseconds()-StartTime
MessageRequester("","Tijd:" + Str(ElapsedTime), #PB_MessageRequester_Ok)
;- ********* End PureBasic code *********
--
HK