Miscellaneous
index, follow
index, follow
There are few types of programming. In this article, we will be focused on procedural and object-oriented programming (OOP). Most of the popular programming languages have possibility to code in OOP way. But what is the difference between procedural and object-oriented programming?
OOP (Object-Oriented programming) is dividing software in different objects, where every object has its own purpose. To illustrate, let's imagine a carpenter who constructs a table. He makes objects like tabletop and table-legs, at the end he unites all to one table. OOP programmers think about other programmers who can access and modify code later. So, in OOP symbolically, a carpenter gives opportunity to other carpenters to change objects like legs and table-top. And, other carpenter can even make a drawer in the table. So, future programmers can easily customize and extend code. Complexed CMSs like Drupal are made in OOP. So, objects are divided to Users, Content, Configuration, Appearance, ... and their sub-objects.
It is making code from one piece. For example, a carpenter can make a table from just one piece of wood, so the legs and tabletop will all be just from one part, that is like procedural programming. How can a carpenter change a broken leg from a table constructed from one piece of wood, or make the table-top wider? He can, but it's very difficult! So, it is difficult for future programmers to extend code, or make changes.
Advantages of procedural programming are:
So, disadvantages of procedural programming are fewer and harder, extending possibilities. Also, other programmers have big problems to find and fix bugs. Procedural programming is a good choice for smaller and temporary projects. For huge projects, procedural programming is a poor solution, OOP is a much better choice. Because, code is cleaner, divided into objects with much easier and understandable access.
Advantages of OOP are:
Also, software made in OOP can be easily updated and upgraded to newer versions. Instead of completely changing code for upgrade, what is mostly case in procedural programming, in OOP, programmer just change deprecated code. But OOP is more robust than procedural programming, has more code and consumes more resources. Software can also be programmed in combined way, procedural and object-oriented programming. So some parts are procedural programmed, but also some are in OOP.
Drupal from version 8 is made in the PHP OOP programming model. Thanks to OOP, upgrading from Drupal 8 to Drupal 9, was much easier, than it was from Drupal 7 to Drupal 8. Because, Drupal 7 was made in procedural programming way, and Drupal 8 in OOP. After Drupal 8, all next versions will be much easier to upgrade.
Most of the programming languages are firstly made for procedural programming and in later versions have been modified for OOP. For example, PHP was founded in 1994, but only after ten years in version PHP 5, it got new feature, support for Object-Oriented programming. But now, most of new programming languages have support for OOP:
Almost every CMF is made in OOP. Because, CMFs have a great need for extension. CMSs are programmed in procedural and object-oriented programming. These are list of popular CMSs and CMFs with way of programming:
Because of high security, eDot.pro for our clients, gives Drupal CMS which is made in OOP.