"Turn" PHP MVC controversy (i)

Source: Internet
Author: User
Tags zend zend framework

The surrounding is always MVC. Why does everyone say that MVC is so powerful that MVC really doesn't understand what the benefits of MVC are.

Arguing with others about MVC in the group, no one agrees with my point of view. My point is that MVC is bloated and inflexible. Then other people in this group have the idea that MVC is very flexible and useful. But they say MVC is not just about cakephp, thinkphp, and ZF. Also say Discuz, Dedecms, WordPress also uses MVC. (Can ignore them)

Listening to their praise for the virtues of MVC, I have listened to the habit. Open 51job, inside the recruitment of PHP, Ten will have a proficient MVC open source framework . But they said that Discuz Dedecms used MVC is really ridiculous. Discuz and Dedecms are useless to MVC at all. The real-life MVC actually refers to the open source framework (cakephp, thinkphp, ZF, etc.).

Until now, there is no use of MVC to get PHP, every attempt is feeling complicated and messy. I've never been able to figure out what's good about MVC, my own code can do what I need, I don't need extra code, and if I use MVC, it's not clear how the code in that big pile of folders is going to work. In addition, MVC maintenance is inconvenient. Error, do not execute, to execute a piece of code to introduce an average of thirty or forty PHP files. The hardware performance is largely ignored. And you can't change his bottom (if it's better to use your own).

。。。。。。。。。。。。。。。

Feel a little tired ....

Do not understand why you can use their own methods to write a website, code, fast, and there is no redundant code, maintenance convenience and fast.
But why do you have to be forced to use MVC? Someone took my code directly to a team to do development with no problem, why do you have to use MVC?
PHP is a simple thing, the data increase, delete, more, choose, why to make so complicated?
Did Dedecms use cakephp? Did discuz use it? Does WordPress use it? Did Phpwind use it?
Which open source program uses the so-called mainstream open source framework???????????????

。。。。。。

Found that many things in the world are not the pursuit of efficiency, many people are blindly chasing. Metaphysics.
MVC in Java is the real mvc,php MVC is not.

This topic is really enough to say, in fact, not only the PHP community, is java. NET these communities, it is the
Oo or not oo, frame or not frame, mode or not mode .... And so on, often discussed to discuss .....

Just say a few words,

In fact, each of us write software in the pursuit of the use of a pattern or framework, the program written to a scale (not very large), you will naturally organize its structure for optimization, such as repeating the code will be written as functions, many Web applications put the same request preprocessing into the common.php .... And so on, as the size of the software increases further, this optimization will be more, but also need to grasp your software as a whole.
And this overall grasp of the software, often depends on your view of the software (abstract), the overall abstraction, in fact, is also a reuse for the software as a whole optimization, (repeating the code is written as a function of the optimization from the details)
From this point on, almost everyone is using the framework, without others, will use their own, without MVC, will also use ABC,CBD (nonsense)

And why MVC is so popular now, nothing special, the first, MVC is very good, the second, the other is not so popular now ....
After that, it's hard to say .... The key in the web itself is changing, it is changing, and in a few years, programming ideas and methods may be completely different.

Then use no MVC, of course, if you think your frame is better, of course you can use it.

A good software success factors, do not say no MVC, is not oo, is not a high-level language, as long as you have enough cattle, in theory, as a compilation can write good software. (Virtually all software is compiled/interpreted as a machine language, so in theory it will be).

OK, it says in theory ..... Later, I said, actually .....

As a matter of fact....

There are many advantages to using MVC and related mature frameworks,
Often listen to people say they write code is not worse than using these mature MVC framework, but if it is really open source, will it be more competitive than zend these?
At least one point, these frameworks open-source has a certain amount of time, widely used, the existence of bugs are easier to detect and correct .... In this regard, many closed-source software is inferior (not to mention personal things), and, for example, the development of Zend is also open, most of the template is in the community after the development of the discussion, constantly based on the feedback of the community to modify, and therefore more able to adapt to the needs of most people.
For the enterprise, the use of mature frameworks, in addition to reducing development time, but also reduce training and new adaptation time, can easily get community support (such as the problem is easy to Google to answer). The benefits are obvious, so it's reasonable to see so many recruiting needs MVC.
For me, I am also inclined to use a mature framework, especially if new projects or existing projects are not based on a stable framework. One is I want to save time, and I definitely can not write the level of Zend code.

Most of the situations are mentioned here, and there are many factors to consider for a particular project. There is nothing right or wrong with or without.

================================================================================

Let's talk a little bit more specific,
To your point of view, "MVC is bloated and inflexible," and I'm against it:)
MVC itself is just a concept, not bloated, inflexible, in fact, you are talking about these frameworks (concrete implementation), that is, cakephp is bad, or zend is not good enough, not the problem of MVC (personally think, Zend than cakephp concise, flexible)

But your zend/cakephp they are a little unfair to your own, because they are a universal framework designed for the entire community, and you are necessarily targeting your existing projects and are vastly different in scope. For them, not every module must be required for each project, but only to provide these rich templates, they can adapt to different projects (this is flexible), and, for example, Zend, the various (most) templates are relatively independent, useless template, will not participate in the operation, there will be no serious impact on the efficiency of the problem .
(If seriously, the framework will certainly affect a bit of efficiency, and the most direct PHP code compared to the words, because the inevitable more processing ah ... But this kind of comparison is a bit like high-level language and compilation ratio, the high-level language of course slow, but ... This is related to how to judge the quality of software problems, and then chat.

To them (who AH) said discuz!, such as also is the MVC of this word ... dedecms I have never seen, do not know, but discuz how can not see MVC come ... This also explains the good (here refers to sell well:)) software is not necessarily MVC, this I support you

Say your question: "Which open source program uses the so-called mainstream open source framework"
This is really not much at the moment ... Cause presumably I can think of:
Many of these well-known open source projects have been around for many years now, and the framework of MVC has not yet matured ....
For example, Discuz and WordPress are both around 2002, and the Zend Framework is the beginning of 2005,
This mature open source project is after a certain period of time to mature, so at present not much is also very normal, in the future will certainly be more up.
Also, as a specialized open source project, relative requirements are relatively fixed, with their own framework is also very normal.

Zend has a lot of internal use, mostly not open source, or not open source.

"Using a mature framework, in addition to reducing development time, can also reduce training and new age adaptation time, can easily get community support"
This is enough, the code is written to at least a person to understand. It takes time to learn, to waste time and resources.

MVC is just a thought (or architecture) rather than a product.
Even if you are writing code using a process-oriented approach, it is inevitably influenced by it (strictly speaking, not by his influence, but by the abstraction of the method).
Open a program of your own, you can see: This part is responsible for the output interface, that part is responsible for the algorithm, they are also connected by the control flow code

MVC is a programming idea that makes your code more readable and maintainable.
Various frameworks have applied MVC ideas.
So to speak, the framework is to MVC, just as the dark Horse is to the horse.
To reach the destination, you can ride a dark horse, or not ride, can ride other horses, and even can walk.

"Turn" PHP MVC controversy (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.