thinkphp, what are the two frameworks for Django, ignoring the language itself?

Source: Internet
Author: User
Help from ease of use, extensibility analysis

Reply content:

You ask thinkphp suitable (0 basis) crash find work, no problem, you ask thinkphp "good", also forget. In contrast to Django, there are people who think that thinkphp is good, and I really want to say it-technically, thinkphp is no match for Django anyway.

thinkphp code quality is very general, the style is particularly bad-a large number of single-letter naming, global functions, global variables (and the combination of single-letter global functions), abusing the get/post array ... Imagine, for example, that a single-letter key was used in the form (for the purpose of confusing or compressing the URL), and the result was a bit of a mystery, and it turned out to be one of the framework's default global GET parameters ... Most of all, these are the features they are proud of! Exposed to the developer of the public interface is this, not to mention within the framework-there are everywhere "indentation" of the divine skill, no unified code specification, the type of PHP conversion caused by the pit is not attention to evade ...

Security is also particularly worrying. And not to mention the details of the quality of the bug, the entire SQL Query Builder design is simply frightening the chin! I did not pay attention at the earliest, also feel as a modern framework (thinkphp 3.X), the use of prepared statement, parameterized query should be basic, it is possible to do a good type binding (especially in dynamic language), however ... Until I saw a succession of thinkphp SQL injection holes in the dark clouds (now there should be a lot of public details, you can search for them), fix a even indirectly led to regression out a new, think a framework how easy to inject, I took a look at those patch patches and the entire SQL subsystem, scaring me ... The authorities have even had a response like "It's designed" and should be responded to by the developers themselves – that's a lot of the time, but I don't feel like passing any value to Query Builder(and there's no compulsion to use features like "unsafe") causing injections to be a problem that developers should be dealing with ...

Speaking of regression, we have to mention the most critical point-where is the test? Anyway, I'm not afraid to use a framework that's so big and doesn't have a unit test. (Knuth's TeX has been tested ... It's not the "master" in the Zen of programming. )

There is another issue that can be discussed--upgrading. I was doing things from thinkphp 1.X to 2.X and then up to 3.X. interfaces, behaviors, and even the entire structure, models will change, remember that the upgrade document is a not thick pdf, a lot of details are not completely covered. In contrast to Django, even when Django was in the early stages of a big change, it did not feel that the upgrade was so painful, and most of the time there were several versions of the deprecated alert ... Not to mention that Django has been a bit smoother for a very long time, and it's a reasonable structure. Of course you can also support this kind of disruptive upgrade, if you are willing to take the time to follow up the big version, otherwise the old version will always end up without security support-see now how many old version of the thinkphp site by the script kid to play?

Thinkphp also has an "advantage", from top to bottom all Chinese--comments, commit message, documents, community ... Really almost a sentence of English also did not (of course, put aside the code), want to have no, clears the need to learn English this big obstacle.

I think that only for historical reasons (although I strongly recommend changing jobs in this case) or technical school crash, other circumstances do not touch the big hole. To discuss the "frame pros and cons", it is Laravel, Symfony and the like vs Django more meaningful.

Update (a.k.a. Off-topic):
A lot of people mentioned CodeIgniter, which is the first frame I've used, and one of the most expensive PHP frameworks I've ever read. To be fair, CodeIgniter's design, architecture and even code quality are good, and the documentation is easy to understand. However, no matter how codeigniter positioning and thinkphp are completely different, it is a lightweight framework, one of the most important differences is that the data layer abstraction is very simple. Unfortunately, its development has stalled for a long time, especially after PHP 5.3 (not using new features, and there are compatibility issues) ... It is not recommended to use 2.x CodeIgniter in new projects (there are too many important new features after PHP 5.3). As for the previous period of time CodeIgniter transferred to me here A college (BCIT) to maintain, launched the 3.x version, no use to comment.

There is a once liked framework is CakePHP, code specification, testing integrity, team active, like its data model, is a few ORM do a good job of PHP framework, debugging is also very powerful, coupled with the automatic generation of code and database, such as "scaffolding" function, Can be said to be more close to Django. Unfortunately, my favorite data Model part of the 2.x version of the implementation of the problem-the history of heavy burden, too complex logic, resulting in extreme situations (such as complex cascade, link) bug, and difficult to repair; I spent time checking bugs, trying to fix them, and the CakePHP team In the final analysis, it is difficult to completely repair without breaking compatibility, so we stayed in the 3.x version to reconstruct the entire data model system. Now 3.0 seems to have come out, but I still have no use ...

Laravel newness, Symfony too heavy, so these two actually I also useless, YAF is completely different direction. The difference between a tractor and a car.

Too many projects in the domestic development environment is farmland ... The time point for the data below is 20150818.

Search on GitHub Search on GitHub
Django
thinkphp thinkphp


There is no comparability, think PHP does not support PDO (SQL injection risk), does not support the namespace, it is said that the new version changed, with this follow-up speed, I will not spit groove laravel floating over the PHP framework, the domestic use of more should be yii it ignore the language itself you talk about a P ah? Many of the features of the framework are based on language characteristics. Thinkphp already stopped updating, so like to use thinkphp people or early change / http ASP Bar ~

Many people in China like to use things that have been obsolete hundreds of years ago, such as thinkphp or Phpwind, this is not good, the project group to choose the framework when you must find someone to maintain the framework, or GitHub to mention a pull request is no one, more upset ~

Django is also a good framework for beginners I have not used TP, but as far as I use TP and YII2 experience. I don't like TP.
= = I see the global function M function in TP the D function feels nauseous (I am an object-oriented thinker) Arnold, is PHP not the best language? Just say TP study pretty fast, 1 a.m.
  • 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.