learning PureBasic
Posted: Tue Sep 11, 2012 6:35 am
I'm just setting into learning PureBasic. Being an old hand at other BASICs, I found it
a bit hard to figure out where to start, because it is quite different in terms of the
syntax and names used from what I've dealt with before. It's almost like there
should be included a cross-reference between terms found in other BASICs and those
adopted for PureBasic to simplify the task of relearning as you progress.
PureBasic is not just a change in terms, but a refinement in what you get. That can
translate into "no exact parity" to "markably improved" over what you had before.
It's no exaggeration to say that you can end up with shorter source code, but then
in looking at source code, you have to read more into what you see to understand it.
The way I am making progress right now is unusual for me. Normally I begin with
some of the example or sample code, compile it, run it to see what it does, then take
a look at the guts of it to see what happened. But that was not working for me with
PureBasic, because I did not understand enough of what I saw to really pick up on it.
What I am doing now instead is reading through the Help system, portion by portion.
Something is underlined in blue, meaning it is a link to another portion, I make sure
to follow it when I've finished reading this part. Then I use the browser Back arrow
to go back until I am back in the Help section, and I go on to the next portion. I'm
not trying to memorize all this, I am just making note of what seems significant.
Once I get the feel for an area, I go on with the expectation that I can find my way
back when I need to later.
Something else the Help section is good for, is that often the example or sample
programs are embedded right in the Help file itself. You can copy and paste these
examples into their own files using the Editor, then compile and run them, and
that works pretty well.
But there is a gap. A series of programs that gradually introduce more aspects of
the language as you progress from one to the next. It's almost a crime that the
first program that most people get exposed to does nothing more that put the
words "Hello World!" on the screen in some manner. It should have at least asked
for a name from the person at the keyboard and said "Hello" to them as well. That
would have linked the ability to do I/O together in a personalized way.
The second program probably should have done something with numbers, as this
is a common use of computers, and as a consequence, worth pointing out. The
third program should have switched to handling strings and dealing a bit with
their contents and how they can be extracted, manipulated, identified, and put
to use. Perhaps the rudiments of putting together an address book.
The fourth program should delve into working with files, how to find them, how
to recognize their possible nature, how to open them, how to read their contents,
how to open output files, how to write to them, so that the nature of reading
and writing with files is essentially covered.
The fifth program probably should work to bring the first four chapters together
in a project, Actually making an address book program would be one purpose,
or getting into the matter of file tracking, working with drives and directory
structures, doing backups and restores, might be worthwhile objectives. You
might need several chapters to cover this area well.
I would expect that at some point the attention would turn to other areas,
such as:
(1) Communications between peers or client/server arrangements, and
the PCP/IP and UDP protocols. There was a time when serial and parallel
port protocols were called for as well, but I suppose it boils down to USB
now.
(2) Game Programming. This is not my area of interest, but it certainly
appeals to many.
(3) Video and audio applications. Goes beyond the scope of games, can
involve movies, clips, music, special effects, working with photographs,
creating or modifying new or existing expressions of art.
(4) Other areas where computers have gained at least a stephold. One
example might be robotics, or machines controlled by computers and
their software. Data mining, which is searching existing avenues of
communications for relevant data that can be extracted, stored, and
processed for later use.
(5) There is the benefits of making use of the mediums by which data
is being exchanged. The wireless world, or wired networks as examples,
and creating new and better tools to exploring or protecting these.
Here is something I've learned about programming that I have never
found expressed anywhere. It might take 8 times the effort to come up
with a suitable program to carry out a routine task, but the payback is
being able to use that program well into the future, which not only
saves time and effort, but let's the user capitalize on the very best
that the program developer was able to achieve in programming and
testing it to satisfaction. The developer had to come up to a high
degree of comprehension in what goes into doing the task to be able
to write a program to meet that objective, and this is going to be
reflected every time that program is used, even if used by someone
totally unfamiliar with the task or how to do it themselves.
a bit hard to figure out where to start, because it is quite different in terms of the
syntax and names used from what I've dealt with before. It's almost like there
should be included a cross-reference between terms found in other BASICs and those
adopted for PureBasic to simplify the task of relearning as you progress.
PureBasic is not just a change in terms, but a refinement in what you get. That can
translate into "no exact parity" to "markably improved" over what you had before.
It's no exaggeration to say that you can end up with shorter source code, but then
in looking at source code, you have to read more into what you see to understand it.
The way I am making progress right now is unusual for me. Normally I begin with
some of the example or sample code, compile it, run it to see what it does, then take
a look at the guts of it to see what happened. But that was not working for me with
PureBasic, because I did not understand enough of what I saw to really pick up on it.
What I am doing now instead is reading through the Help system, portion by portion.
Something is underlined in blue, meaning it is a link to another portion, I make sure
to follow it when I've finished reading this part. Then I use the browser Back arrow
to go back until I am back in the Help section, and I go on to the next portion. I'm
not trying to memorize all this, I am just making note of what seems significant.
Once I get the feel for an area, I go on with the expectation that I can find my way
back when I need to later.
Something else the Help section is good for, is that often the example or sample
programs are embedded right in the Help file itself. You can copy and paste these
examples into their own files using the Editor, then compile and run them, and
that works pretty well.
But there is a gap. A series of programs that gradually introduce more aspects of
the language as you progress from one to the next. It's almost a crime that the
first program that most people get exposed to does nothing more that put the
words "Hello World!" on the screen in some manner. It should have at least asked
for a name from the person at the keyboard and said "Hello" to them as well. That
would have linked the ability to do I/O together in a personalized way.
The second program probably should have done something with numbers, as this
is a common use of computers, and as a consequence, worth pointing out. The
third program should have switched to handling strings and dealing a bit with
their contents and how they can be extracted, manipulated, identified, and put
to use. Perhaps the rudiments of putting together an address book.
The fourth program should delve into working with files, how to find them, how
to recognize their possible nature, how to open them, how to read their contents,
how to open output files, how to write to them, so that the nature of reading
and writing with files is essentially covered.
The fifth program probably should work to bring the first four chapters together
in a project, Actually making an address book program would be one purpose,
or getting into the matter of file tracking, working with drives and directory
structures, doing backups and restores, might be worthwhile objectives. You
might need several chapters to cover this area well.
I would expect that at some point the attention would turn to other areas,
such as:
(1) Communications between peers or client/server arrangements, and
the PCP/IP and UDP protocols. There was a time when serial and parallel
port protocols were called for as well, but I suppose it boils down to USB
now.
(2) Game Programming. This is not my area of interest, but it certainly
appeals to many.
(3) Video and audio applications. Goes beyond the scope of games, can
involve movies, clips, music, special effects, working with photographs,
creating or modifying new or existing expressions of art.
(4) Other areas where computers have gained at least a stephold. One
example might be robotics, or machines controlled by computers and
their software. Data mining, which is searching existing avenues of
communications for relevant data that can be extracted, stored, and
processed for later use.
(5) There is the benefits of making use of the mediums by which data
is being exchanged. The wireless world, or wired networks as examples,
and creating new and better tools to exploring or protecting these.
Here is something I've learned about programming that I have never
found expressed anywhere. It might take 8 times the effort to come up
with a suitable program to carry out a routine task, but the payback is
being able to use that program well into the future, which not only
saves time and effort, but let's the user capitalize on the very best
that the program developer was able to achieve in programming and
testing it to satisfaction. The developer had to come up to a high
degree of comprehension in what goes into doing the task to be able
to write a program to meet that objective, and this is going to be
reflected every time that program is used, even if used by someone
totally unfamiliar with the task or how to do it themselves.