Tutorial: PureBasic and the OOP
Posted: Mon May 09, 2005 9:56 pm
Hi everybody!
Because a tutorial doesn’t exist to clarifies this purpose in PureBasic, find here a tutorial dealing with OOP implementation in PureBasic
Tutorial: PureBasic and the OOP
This tutorial does not explain the reason to be of the object-oriented programming but simply how we can implement it in a language as PureBasic.
If the tutorial resumes the definitions of the OO concepts, it is to be in agreement with the reader on the concept definitions that will be employed.
Nevertheless let me try to suggest in some lines the interest of OO for those who wish it:
For me, the object concept brings a concrete answer to the developer in the way of conceptualize its code.
To conceptualize, understand that we group the alike elements, to work at first on the common similarity (object classes) and postpone as far as possible the differences (objects themselves).
This approach suggests coding only the minimum because we limit the redundancy.
A classic example to illustrate:
We can describe a rectangle and a circle in an independent way and thus create so many different codes.
Nevertheless both are forms: thus they have some similarities.
The purpose of the object-oriented approach is to bring the developer to implement only once the similarity. The advantages are normally: fewer codes, more light, a code more strong in front of modifications …
This example is simple and, of course, procedural approach also allows to reduce a such redundancy.
Simply the object-oriented programming suggests structuring its procedural programming to have a better answer to this requirement.
Every programmer tries to simplify his codes and the object-oriented is a technique to achieve this goal.
But to completely feel the advantage of the object representation, I can only advise you to learn also about the design patterns.
These last ones do not deal as a language in particular (but it must however be object-oriented). They process common programming problems and give an adapted solution in term of limiting redundancies.
To my taste, they give all the sense to the OOP.
But don’t imagine that OOP has got only advantages. Some running performances are lost because of many memory allocations and functions call.
Well! I hope simply that my english translation will be good enough and made the tutorial also pleasant and profitable for you in the reading, than it was for me in its writing…
Because a tutorial doesn’t exist to clarifies this purpose in PureBasic, find here a tutorial dealing with OOP implementation in PureBasic
Tutorial: PureBasic and the OOP
This tutorial does not explain the reason to be of the object-oriented programming but simply how we can implement it in a language as PureBasic.
If the tutorial resumes the definitions of the OO concepts, it is to be in agreement with the reader on the concept definitions that will be employed.
Nevertheless let me try to suggest in some lines the interest of OO for those who wish it:
For me, the object concept brings a concrete answer to the developer in the way of conceptualize its code.
To conceptualize, understand that we group the alike elements, to work at first on the common similarity (object classes) and postpone as far as possible the differences (objects themselves).
This approach suggests coding only the minimum because we limit the redundancy.
A classic example to illustrate:
We can describe a rectangle and a circle in an independent way and thus create so many different codes.
Nevertheless both are forms: thus they have some similarities.
The purpose of the object-oriented approach is to bring the developer to implement only once the similarity. The advantages are normally: fewer codes, more light, a code more strong in front of modifications …
This example is simple and, of course, procedural approach also allows to reduce a such redundancy.
Simply the object-oriented programming suggests structuring its procedural programming to have a better answer to this requirement.
Every programmer tries to simplify his codes and the object-oriented is a technique to achieve this goal.
But to completely feel the advantage of the object representation, I can only advise you to learn also about the design patterns.
These last ones do not deal as a language in particular (but it must however be object-oriented). They process common programming problems and give an adapted solution in term of limiting redundancies.
To my taste, they give all the sense to the OOP.
But don’t imagine that OOP has got only advantages. Some running performances are lost because of many memory allocations and functions call.
Well! I hope simply that my english translation will be good enough and made the tutorial also pleasant and profitable for you in the reading, than it was for me in its writing…