in reply to use of Object oriented program in perl
In general OO programming is a different way of thinking about organising code and data. In procedural programming the code is in a sense primary with the focus on the algorithm. In OO programming the focus tends more to be on the data. An object is really a ball of data. A class describes the things that can be done to the data contained in an object.
I very often use OO techniques in small programs to save passing extra parameters around or to avoid using global variables. When writing modules OO techniques provide a number of advantages. OO:
and so on. OO doesn't remove the utility of modules which are a way of organising code into libraries that can be reused. Nor does OO do away with subroutines, but it does change their role somewhat.
|
|---|