
(
Source )
I want to make my "5 kopecks" in the unabating dispute of opponents and supporters of the PLO. From recent publications on this topic, we can note the brightly negative title
“The faster you forget OOP, the better for you and your programs” , the more peaceful
“Stop arguing about functional programming and OOP” and moderately positive
“Object-oriented programming in graphic languages” .
But the idea of ​​this note came from a
comment to another article:
A great example for the fact that the PLO is just awful. The system of traits perfectly realizes your case, and does not require at all to answer the Existential Question of Object Programming - “What Is an Object?”. [...] Forget about OOP, it was a good metaphor for the GUI, which they tried to build into the status of a religion.
In my opinion, this is a very indicative typical comment, where it is not the OO approach that is criticized (even OOP in the GUI is given its due), but myths that have arisen around OOP. Thus, in my opinion, everyone is right: both supporters when pointing out the convenience of the PLO, for example, when programming the GUI, and opponents when they are indignant at the building of the PLO in the status of a silver bullet, an absolute weapon.
It should be noted right away that in each OO YaP its OO approach is sometimes very, sometimes not very different from other OO approaches. I will proceed from Pascal’s moderate simple approach, which was already incorporated in Turbo Pascal 5.5 and finally shaped to Delphi 7 (similar to those of other manufacturers, for example, Think Pascal for MacOS, can be noted). There are fundamental principles in this OO approach: encapsulation, inheritance (simple), polymorphism; and significant limitations: for example, there is essentially no very complicated
multiple inheritance .
')
As already written in the
commentary to the article mentioned above, the transition from classical Pascal to OO Pascal looked, in my opinion, very visual and justified:
The simplest encapsulation is already in the records. Further, the concept of inheritance comes in such simple examples:
type
TCoord = record //
x, y : integer
end;
TRect = record //
leftTop, RBot : TCoord;
end;
«record» «class» ( ), «» .
— , , GUI. « „ ?“». — , — — . . , , ! ( ). — , , . — . , , , , , — , . , . , — . , . ? — : . , . .:
.., .., .. . .
. ., . . 3-, . .: , 2007, . 3 , , . , . . , . : , . , - ;)
,
,
,
., , , . , . — . — , , :
[...] , .. IDE GUI, .
, , , . : « — ». , - , , , . : - . , . (
, , : , , , .) — , , , , .