Porting from Blitz, first impressions
Posted: Wed May 25, 2005 10:09 am
Hi everybody,
I've "struggled" for some days with Purebasic and my "Blitz-formed" mind started to change. (I've been using Blitz since 2001).
Seemingly PureBasic gives more flexibility (smaller executable) for the price of more complicated coding.
For example, if I open a screen (set graphics mode) in Blitz then every
drawing command will work on the frontbuffer (unless I specify the
backbuffer to allow double buffering). While in Purebasic I have to
put my drawing (mostly) between startdrawing and stopdrawing blocks.
It requires a bit more attention when constructing the source.
There are other examples like locate before drawing something (what has its advantages (less parameters in drawing functions), and disadvantages (two lines of source for one result) as well ). Or ExamineMouse before using Mouse functions (first I thought that InitMouse would do, but not).
It requires more attention, a bit longer source, a bit more probabiltiy of errors , but it gives more freedom and flexibility, smaller executable (and probably faster, since it doesn't refresh keys or mouse constantly).
Overall I am very content with PureBasic, though I have to get used to it and know it.
One strange thing what bothers me a bit (some seasoned Purebasic coder, or Fred might help me).
It is the currency of objects. I mean many commands refers itself that it works on the "current" screen, sprite, image etc.
On the other side this currency is many times set by some kind of command like CreateImage what (I guess) sets the current image to the created one. It means that one should follow this currency in one's code to secure proper execution, ie I experienced some errors (what were solved later by me) when I haven't followed it exactly.
I mean, for example it would be nice that I could set directly what is the object I am talking about.
For example:
Result = OpenScreen(Width, Height, Depth, Title$)
StartDrawing(ScreenOutput(Result))
would be nice. Now it gives an "Incorrect number of parameters" error, but it means that I has to know which is the current screen (whose ID is returned by ScreenOutput).
The other thing I would be very happy with if there would be marked the commands in help with something like this: "This command sets/changes the current screen/image/sound etc".
What do you think? How do you handle this issue?
(PS: Anyway, PureBasic is just great, complex and useful, with many possibilities.)
I've "struggled" for some days with Purebasic and my "Blitz-formed" mind started to change. (I've been using Blitz since 2001).
Seemingly PureBasic gives more flexibility (smaller executable) for the price of more complicated coding.
For example, if I open a screen (set graphics mode) in Blitz then every
drawing command will work on the frontbuffer (unless I specify the
backbuffer to allow double buffering). While in Purebasic I have to
put my drawing (mostly) between startdrawing and stopdrawing blocks.
It requires a bit more attention when constructing the source.
There are other examples like locate before drawing something (what has its advantages (less parameters in drawing functions), and disadvantages (two lines of source for one result) as well ). Or ExamineMouse before using Mouse functions (first I thought that InitMouse would do, but not).
It requires more attention, a bit longer source, a bit more probabiltiy of errors , but it gives more freedom and flexibility, smaller executable (and probably faster, since it doesn't refresh keys or mouse constantly).
Overall I am very content with PureBasic, though I have to get used to it and know it.
One strange thing what bothers me a bit (some seasoned Purebasic coder, or Fred might help me).
It is the currency of objects. I mean many commands refers itself that it works on the "current" screen, sprite, image etc.
On the other side this currency is many times set by some kind of command like CreateImage what (I guess) sets the current image to the created one. It means that one should follow this currency in one's code to secure proper execution, ie I experienced some errors (what were solved later by me) when I haven't followed it exactly.
I mean, for example it would be nice that I could set directly what is the object I am talking about.
For example:
Result = OpenScreen(Width, Height, Depth, Title$)
StartDrawing(ScreenOutput(Result))
would be nice. Now it gives an "Incorrect number of parameters" error, but it means that I has to know which is the current screen (whose ID is returned by ScreenOutput).
The other thing I would be very happy with if there would be marked the commands in help with something like this: "This command sets/changes the current screen/image/sound etc".
What do you think? How do you handle this issue?
(PS: Anyway, PureBasic is just great, complex and useful, with many possibilities.)