Which of the following aspects is better for thinkphp and yii?

Source: Internet
Author: User
Php framework reply content: Regarding the comparison of tp and yii, the first point is that yii and tp are not of a level (Do you know the difference between the gender and super gender ?), In addition, I personally dislike tp. The main reason is that tp is too self-righteous and has done a lot of convenience for Chinese people. For example, a pork boss sells your pork, you want a pound of lean meat. He will give you two pound of bones, one pound of fat, one or two lean meat. This is tp, and yii is the boss next door. You want a pound of lean meat, he will give you a kilo. The effect of yii's use of configuration and components is that if you want anything, he will give it to you (the point is that you will not configure it, so it is hard to learn), and tp will get everything done, it seems that thinkphp and yii are not of the same magnitude ...... Thank you!
---------
Conclusion: yii is better and better than thinkphp.
To answer what they are, we must first understand what the framework is.
The role of the framework: 1. Simplified development. 2. Improve the maintainability of the project. 3. Avoid the pitfalls and traps of programming languages.
Then we will discuss the advantages and disadvantages of the two from these three aspects.
1. Simplified development: thinkphp is simpler to implement projects from the perspective of beginners (or on the surface), because it provides most common web development class libraries, the second Chinese manual is detailed. But in fact, thinkphp has two missing features, which may cause headaches once the project is too long or a little scaled. The two missing features are: complete AR support and complete multi-level model
Second, most of the Code in web project development is repeated, so automated code generation tools are essential. As of tp3.2.3, I still don't see any indication of tp's support for automated chemicals
2. maintainability: the complete AR and multi-layer models are missing, and the Code cannot be neatly organized. If there are more code, the source code must be as messy as the noodles. Most importantly, TP does not have unitTest, which leads to no reconstruction. Similarly, in terms of databases, tp lacks data migration tools, which makes it very difficult to maintain the project in the future.
3. Avoid the pitfalls and traps of programming languages: tp and Yii are implemented by PHP, and PHP itself has many pitfalls and traps, such as the unclear relationship between chaotic language structures and functions, the trap of variable conversion, and the name of messy class libraries. These improvements have basically been made in yii. Yii is fully built in an object-oriented way, and common web class libraries are presented as components. Finally, PHP programmers can write code while Baidu: which function should be used for the 'xx function. In contrast, TP only encapsulates frequently-used class libraries into classes, and has never been carefully designed for what to use. It is like a programmer who has collected some class libraries for many years, thinkphp is a pseudo-MVC framework.
-----------------------------------------------------
Last words:
I spoke about thinkphp, but in fact thinkphp is fully qualified in the production environment. Most domestic projects are currently built on TP. From the operation practice, TP fully complies with the production standards, and the user volume is also the largest. The excellent tp and Yii are naturally yii, which is like python is superior to php in any aspect, however, yii is better overall than php. The advantage is that it is lightweight and the cache is good. There are many implementation methods to avoid dependency on php extension, the execution performance is higher than that of TP.
Of course, TH also has its own. For example, the Community is very popular, and the tutorials for beginners in Chinese are very detailed and easy to use. The disadvantages are also obvious. For example, there are many bugs .... I have never played ThinkPHP. At least Yii2 is better at internationalization and ThinkPhp is better at localization.

First, if someone thinks we should support Chinese products unconditionally:
Support patriot cameras. The new machine will be equipped with 360 security guards. By default, the Internet will search for viruses. If you are ill, you will only watch Chinese medicine. If you like the default recommendations from Chinese News clients, go to the chicken blood forum, reading the People's Daily News and the world's daily news never go over the wall and resolutely resist Japanese goods ......
So I think this kind of person may not be suitable for the programming industry.

As for the difference, first of all, ThinkPHP is easy to ignore, that is, its influence. The internationally famous Framework benchmark will not consider ThinkPHP. It is difficult to find materials from various aspects, and the quality and quantity of technical posts in China are difficult to compare with those in the world. ThinkPhp is not available on StackOverFlow, the world's most famous technical Q & A website.

Of course, ThinkPHP may not be a bad choice if the demand for internationalization is zero and your English is not very good. Especially when developers are Chinese and there are no foreign or local customers. In addition, after the application of Composer, It is theoretically supported by the HDR standard, and the framework components can be mixed. Yii has only one advantage in that the core developer is the initiator of the dsrs and a member of the PHP framework Collaboration organization.

The only piece of advice for technology selection is not the technical platform supported by you, but the objective comparison of whether they are applicable to the current application scenario. The simplest example is NoSQL. The database to choose depends on the application scenario. Some other data storage solutions do not work, but are more suitable for scenarios. All solutions use MySQL, MongoDB, and Cassandra. Similarly, if you like lightweight RESTful backend + front-end design, you can choose to use micro-framework, such as Slim framework or selix. If you have high performance requirements, you can choose to use Micro-ORM instead of ActiveRecord. if the business is complicated, I think ActiveRecord may not be enough. You must use DataMapper or even Repository Pattern. no framework can cover 100%, neither being able to do it nor necessary.

Laravel/Symfony is also worth recommending. The former has a great syntactic sugar and many fans. The latter and its flexibility are also well-known in the PHP field.
But sometimes they don't really care about performance or the like. This "A and B" problem is all nonsense. Always remember that whatever you want is the best for you. For example, if you want to make A few simple pages, any framework is redundant! No. I hope LZ will .. Both are used. If you want to quickly recruit people, the recruitment level is not too high. The tp option is correct. On the contrary, yii lavara symfony can be very powerful in yii. Thinkphp: Read the source code twice and you will understand it. Now I am using thinkphp as a class library. That is to say, some common methods are directly copied from thinkphp... I found it online...
We recommend that you take a look at yii. Great. The cache is very good. I suggest you use ThinkPHP5 to explain it. I have read many comparison posts and summarized some of them.


Tp is good. Many people in China use it for fast development, easy to use, and easy to learn. He means that he is learning tp
Yii is good, foreign is forced to be high, and the level is naturally high. He means that he learns yii

In my personal sense, tp and yii both work. There are a lot of people using both of them, and there are too many documents, so I don't want to learn other frameworks, such as ci. In fact, I mean to say, I have both tp and yii.

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.