I want to know which is the best to code, I see alot of people using php procedural, what is diferent between them and which is easy to use ?
That depends on your definition of ābestā. procedural is usually faster, but object-oriented is better from a design point-of-view.
I suppose it also depends on what you want the code for. If you do not need to use OOP you will write less code.
But less code does not necessarily mean that the code is easy to read, maintain, or modify.
The OP could use functions; anyway as I said it depends on what the OP is doing with the code. The only time I tried to use it and posted here I was told there was no point in using it for what I was doing.
What about mysqli_connect (I mean procedural) extention in future ?
do they gonna stop it again like mysql ?
what I see is php pushing developers to use pdo or object oriented.
No, since the mysqli functions are essentially a wrapper around the mysqli objects.
It seems like you are asking a question only to have someone say that procedural programming is ābetterā than OOP. Despite that its well known in the engineering community that OOP offers numerous advantages in regards to organization, maintainability, scalability, etc. No well known modern languages are strictly procedural. Ruby, C#, JavaScript, Python, Java etc. are all either object-oriented or provide object-oriented components within them. Had PHP not began implementing OOP principles it would probably be nearly dead today. Furthermore, look at the php ecosystem. There isnāt one well known, popular framework or library that isnāt built using object-oriented programming except for Wordpress. I think those facts speak to superiority of object-oriented programmings advantages over procedural. I would debate that anyone that says otherwise is exercising intellectual laziness.
lol. Not really,
I am working on oop
I dont like tht old codes but its easy lol
I see both sides. I agree with @ZooKeeper that OOP is the superior programming method.
But @Dormilich and @Rubble are correct in saying it depends on what you are doing.
I think procedural is fine for very basic entry level PHP usage where OOP may be an over-kill.
But anything beyond the basics OOP is the way to go.
As we just go for random attributes like quantity here: i suggest measuring the a count of languages for both of these two paradigms:
maybe nobody every eally tried to implement complex code in functional programming in PHP. plus the higher order functionality is younger than OOP in PHP.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.