pop vs oop (mysql vs mysqli)
Basically, MySQL is the old database driver, and MySQLi is the Improved driver. The "i" stands for "improved" so it is MySQL improved.MySQLi can be done procedural and object-oriented whereas MySQL can only be used procedurally. Mysqli also supports prepared statements which protect from SQL Injection.The main useful features are:an Object-oriented interface support for prepared statements support for multiple statements support for transactions enhanced debugging capabilities embedded server support. NOTE: MySQL was deprecated in PHP 5.5.0 and was removed in PHP 7.
Procedure-oriented Programming(POP) and Object-oriented programming(OOP) both are the programming approaches, which uses high-level language for programming.A Program can be written in both the languages, but if the task is highly complex, OOP operates well as compared to POP. In POP, the ‘data security’ is at risk as data freely moves in the program, as well as, ‘code reusability’ is not achieved which makes the programming lengthy, and hard to understand. Large programs lead to more bugs, and it increases the time of debugging. All these flaws lead to a new approach namely “object-oriented programming”. In object-oriented programming’s main concern is given on ‘data security’; it binds the data closely to the functions which operate on it. It also resolves the problem of ‘code reusability’, as if a class is created, its multiple instances(objects) can be created which reuses the members and member functions defined by a class.
Procedure-oriented Programming(POP) and Object-oriented programming(OOP) both are the programming approaches, which uses high-level language for programming.A Program can be written in both the languages, but if the task is highly complex, OOP operates well as compared to POP. In POP, the ‘data security’ is at risk as data freely moves in the program, as well as, ‘code reusability’ is not achieved which makes the programming lengthy, and hard to understand. Large programs lead to more bugs, and it increases the time of debugging. All these flaws lead to a new approach namely “object-oriented programming”. In object-oriented programming’s main concern is given on ‘data security’; it binds the data closely to the functions which operate on it. It also resolves the problem of ‘code reusability’, as if a class is created, its multiple instances(objects) can be created which reuses the members and member functions defined by a class.
| BASIS FOR COMPARISON | POP | OOP |
|---|---|---|
| Basic | Procedure/Structure oriented . | Object oriented. |
| Approach | Top-down. | Bottom-up. |
| Basis | Main focus is on "how to get the task done" i.e. on the procedure or structure of a program . | Main focus is on 'data security'. Hence, only objects are permitted to access the entities of a class. |
| Division | Large program is divided into units called functions. | Entire program is divided into objects. |
| Entity accessing mode | No access specifier observed. | Access specifier are "public", "private", "protected". |
| Overloading/Polymorphism | Neither it overload functions nor operators. | It overloads functions, constructors, and operators. |
| Inheritance | Their is no provision of inheritance. | Inheritance achieved in three modes public private and protected. |
| Data hiding & security | There is no proper way of hiding the data, so data is insecure | Data is hidden in three modes public, private, and protected. hence data security increases. |
| Data sharing | Global data is shared among the functions in the program. | Data is shared among the objects through the member functions. |
| Friend functions/classes | No concept of friend function. | Classes or function can become a friend of another class with the keyword "friend". Note: "friend" keyword is used only in c++ |
| Virtual classes/ function | No concept of virtual classes . | Concept of virtual function appear during inheritance. |
| Example | C, VB, FORTRAN, Pascal | C++, JAVA, VB.NET, C#.NET. |
Comments
Post a Comment