Need oop for wordpress theme? [duplicate]

It will be better if you code theme in OOPS(Object Oriented Programming) because OOPS provides following benefits over normal/procedural oriented programming.

Benefits of Object Oriented Programming

  1. Modularity:
    The source code for a class can be written and maintained independently of the source code for other classes. Once created, an object can be easily passed around inside the system.

  2. Information-hiding:
    By interacting only with an object’s methods, the details of its internal implementation remain hidden from the outside world.

  3. Code re-use: If a class already exists, you can use objects from that class in your program. This allows programmers to implement/test/debug complex, task-specific objects, which you can then use in your own code.

  4. Easy Debugging: If a particular object turns out to be a problem, you can simply remove it from your application and plug in a different object as its replacement. This is analogous to fixing mechanical problems in the real world. If a bolt breaks, you replace it, not the entire machine.

Cost of Object Oriented Programming

Object oriented design is complicated to do well, and a substantial amount of time is likely to be required to learn it in depth. If you have been developing procedural systems for some time then object oriented concepts will require learning a different way of thinking which is always challenging and requires effort.