PHP coding procedural vs object oriented [closed]
Procedural coding vs object oriented. Which is the best from the application point of view? Can an application function better with an object oriented coding? or be slower?
Don't think there is a 'best' here. Each have their own use and should be explored depending on what the context of the application is.
It depends upon the kind of application you are building. If the application is very simple one, (e.g. add_two_nums(x,y)) then OO is overkill. There are times when a very simple application starts expanding and becomes a complicated one. If there is a chalked out plan of such scenario, then OO is better because even though initially it seems overkill, in future, it will help to expand the application with ease. I have not seen any performance issues between procedural style and OO approach. Someone might throw some light into it.
精彩评论