PHP Procedural Method or Object Orientation

Asked

Viewed 257 times

1

  • Which of the two are safe?
  • Can Procedural work only at Procedural
  • Pros and Cons of Procedural
  • Could you contextualize? The questions are too vague, almost impossible to say which is the right way.

  • I am starting a project because I know little of object orientation I want to know if what the difference in the two methods of programming advantages and disadvantages, I am after opinions and not texts taken in books

  • Almost everything in programming is procedural, even OO code is procedural. From a look here regarding the terms.

1 answer

1


Both of them are safe. Object-oriented programming, in addition to all its facilities such as inheritance, polymorphism and among others, helps you keep the logic of programming well applied. Your code "becomes part of the real world", where your classes will be treated as Entities, your methods/functions will be treated as Actions of these Entities, your attributes/properties will be as Qualities of these Entities. On the other hand the procedural code is faster to implement a simple system with unique crude where there is no need for treatments. There are also frameworks such as Laravel, Codeigniter, Cake PHP among others that help you in object-oriented programming as well as giving you many ready-to-use code options. It is only the criterion of the need to use each of them. I hope to have helped. Hug.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.