Hey I was wondering if creating a Model View Framework was still the most efficient way to use PHP. If so could someone post a little guidance down below on how to actually create an MVC application. If MVC is not the most efficient way what is? Thank you :)
|
PHP
Is MVC still the most efficient way to code PHP? |
|
Oct 13, 2015 04:43 PM
(This post was last modified: Oct 13, 2015 04:43 PM by dersuss.)
There is no best way to do anything.
Some people say object oriented is the best way to do things, other people argue that since they say it slows things down because of the abstraction and the use of many objects which causes alot of memory usage. Look at Linus torvalds how he reacts to C++. My opinion is do whatever is faster :P, but that's just me.
Depends on what you mean by efficient. Realistically you could make a really optimized application consisting of just functions and globals that outperforms an application designed using MVC. But it will be shit and unmaintainable. It's a tradeoff between performance and good design practices. Do what you want
(Oct 13, 2015 04:59 PM)6577657534735 Wrote: Depends on what you mean by efficient. Realistically you could make a really optimized application consisting of just functions and globals that outperforms an application designed using MVC. But it will be shit and unmaintainable. It's a tradeoff between performance and good design practices. Do what you want When I say 'efficient' I mean how easy it is to go back and change a section of the code without it effecting everything in the entire application. (Oct 13, 2015 04:59 PM)6577657534735 Wrote: Depends on what you mean by efficient. Realistically you could make a really optimized application consisting of just functions and globals that outperforms an application designed using MVC. But it will be shit and unmaintainable. It's a tradeoff between performance and good design practices. Do what you want MVC could be used in procedural programming not just OOP practices. Also you could make a really good code in procedural that will be readable and maintainable. That's just a matter of practice and experience.
Oct 14, 2015 09:16 AM
(This post was last modified: Oct 14, 2015 09:17 AM by SIM-1947090.)
I would definitely go for MVC pattern..
And, those who say "OOP makes applications slow" is just...Seriously? 🎉 Gopher
(Oct 14, 2015 12:07 PM)Yani Wrote: MVC has it's uses. It's only good for people who always use frameworks with a MVC model (as a base for starting their websites) or for projects with multiple coders. Excuse me, but i have to be rude here, i find myself quite offended. 1.) "It's only good for people who always use frameworks with a MVC model" - this is wrong big time. What made you write that? You do realize separating application logic from "user interface" is a giant advantage in writing your code/applications? 2.) "or for projects with multiple coders." - this is like 1% of what MVC is good for (there is still like 99% to accomplish) 3.) "It's only a possibility that you either love or hate." - seriously? something you either love or hate? 4.) "OOP on the other hand is something where you define "stuff" as objects" - just dont say you think this piece of code makes it OOP - "$ob = new SomeClass();"?? Once again, i apologize for being rude, but this just made me angry 😵 Gopher
(Oct 14, 2015 03:02 PM)Yani Wrote: No offence taken. I can't always bring over this point of view in English as it isn't my main language. Sorry for late response (as i said in other post, i was busy...) 3.) Well, thats something i can accept actually. It's better rephrased ;) 4.) In that case, i accept your statement And aah, if you are talking about websites, then yes, you are correct. MVC and frameworks are very likely going to be overkill for a website. I probably didnt understand this topic correctly, i had web applications in my mind (real applications, not some random web site). Gopher
|
|
|

