After reading laravel's php framework, how does it feel unreliable?

Source: Internet
Author: User
Tags php excel drupal
I heard that laravel is very popular, so I used it for a while. I didn't go deep into it. I just read the Quick Start and I lost a little interest. I 'd like to ask for details. If all these tasks are completed by calling various third-party packages in composer mode, the flexibility is not too low. Although the wheel is not repeated, it is the same thing in the end, is there a good security guarantee? I heard that the efficiency is not high. How much faster can I develop without using a third-party package? Will it be inferior to other frameworks? Append: some of the answers I think I have heard that laravel is very popular. I just read it and didn't go into it. I just read the Quick Start and lost a little interest after reading it, for more information, see. If all these tasks are completed by calling various third-party packages in composer mode, the flexibility is not too low. Although the wheel is not repeated, it is the same thing in the end, is there a good security guarantee? I heard that the efficiency is not high. How much faster can I develop without using a third-party package? Will it be inferior to other frameworks?

Append: Some people think that laravel is not in-depth enough, so the comments are not objective and OK. I think this is also possible. Although the first senses are poor, in order not to draw an arbitrary conclusion, I decided to go further. If not, I would come back to refute you later, hum, = P. Reply content:
Son of Wucheng, heard the sound of string songs. The husband smiled and said, "Cut the chicken and use the ox knife 」. --- Analects of Confucius
We learn a framework not because it is easy to learn, but because it is efficient and powerful.

The emergence of Laravel framework brings PHP back-end development into a new height, among which composer and PHP-FIG, it indicates that PHP is no longer just a "front-end language" or "display layer language.

PHP is easy to get started, and PHP is a syntax that is a collection of C Perl and so on. After learning for half a day, I can use it as a website.

For most PHP frameworks, ThinkPHP or CI is preferred. Because the thresholds of these frameworks are very similar to those of PHP. If Java is used for development for half a year, most PHPer cannot accept it. If a framework (such as SSH) takes half a month to get started, PHPer won't be able to get started, so TP and CI frameworks are widely used. (ZF, which is comparable to the PHP and SSH frameworks, is also despised by PHPer and useless. This Java stinking problem is everywhere)

With the advent of Laravel, I did not hesitate to transfer from CI to the Laravel camp.

If you are just a customer Write a websiteIf you want to improve efficiency, you can use TP or CI.

However, if you are developing a project for the company or yourself for more than five years, then the disadvantages of CI are highlighted. In the past five years, it is estimated that all CI versions have been upgraded to version N, and PHP has also upgraded to version N. Are you upgrading?

The project is developed and debugged locally. When problems occur after the project is launched, how can we find and track it? The most common method is log. Now almost every framework has the log function, but Laravel's other strength is that his log follows the PHP-FIG, that is, you can freely change the log implementation class to improve performance. This is like our PC, which has USB InterfaceIn this way, we can replace any USB device, such as USB mouse, USB keyboard, and USB hard disk. Laravel provides the log Interface Based on PHP-FIG standards, and we only need to replace the implementation.

Now the question is, Excavators ......Now many pcs support USB 3.0. When we buy a hard disk, we can buy 3.0 to achieve a higher speed. Laravel uses composer for management Package dependency.
If all of these tasks are transferred to a variety of third-party packages in composer mode, the flexibility is not too low.
The use of composer is not TransferTo manage, Manage packages and versions of various packages. This solves the compatibility issues of various packages. Before the emergence of composer, PHP still had no effective solutions to these problems. If you need an Excel import/export function, you can search for the PHP Excel database. In most cases, you can download the latest stable version from the official website. If something goes wrong, search for Google or Baidu ~ It turned out to be a version issue. This database uses anonymous functions, which are not supported by PHP 5.3. You can only download previous versions ~~".

Composer brings engineering ideas into PHP.

How much faster can I develop without using a third-party package?

If only Development SpeedLaravel is undoubtedly inefficient and bulky. This obviously does not match "the best language in the world. However, if you have developed large and medium-sized projects, you will find that Coding does not even occupy 1/3 of the total project stage. The development cycle may be three months, but the entire project lifecycle is indeed three years.

If your trip is 10 kilometers, it is undoubtedly the fastest way to drive. If you fly, it is estimated that you have not had time to take off. If the itinerary is 100 meters, walking is undoubtedly the fastest.

Another problem ignored by PHPer is unit testing. The same is the MVC framework, but many PHPer are MVC for MVC and design patterns for design patterns. However, I do not know why. If you ask why a PHPer uses MVC and the mode, most of them cannot be answered.

This afternoon I also saw a similar question in sf about the ThinkPHP model. The code can be written in the controller, which is faster. It is true that most PHPer does not know why Hierarchical architecture is required, even if the framework is used.

Speaking of layering, any java framework can throw several streets of PHP. (PS: I can see from my name that I am a java fan, but I firmly believe that PHP is the best language in the world)

Now there is a controller that handles transfers. In this process, form verification, controller processing business logic, persistence (stored in the database), rendering view, and some security processing and log functions are required.

In the traditional PHP development process, all are encoding, running, debugging, and debugging errors until the operation is successful. Then, open the browser, enter the data, click execute, and check the result. If the result is correct, enter the data again. If the error occurs, modify, debug the data, open the browser, repeat the data, and repeat the data until you are satisfied.

You can also use PHPUnit to write the transfer function into one (several) separate class to test the core functions of the transfer. However, we still need some black magic to test the controller and model. If it is in SSH, it is So Easy. Any module can be used separately for unit testing. Any module can run independently from the SSH framework.

In SSH, we can take out the controller and put it in JUnit to test the controller function. We can also take out the router module to test whether the URL route is correct. And so on. In the CI or TP framework of PHP, the controller cannot be used separately for testing.

Laravel's contribution to PHP engineering is -- Testability. Amount... Amount... Amount...
It's hard for php to have a composer. Are you saying it's useless? The framework is designed for project sustainability rather than developing a project quickly ..

In an age where everything needs to be iterated and updated, there is no sustainable architecture, and it is useless.

If your system has hundreds of functions and each function depends on each other, in addition to package management, what is the best way to enable the orderly development of several hundred teams? It is strongly recommended to learn laravel. You will find that you will learn more outside of the framework during the learning process.
1. How to overturn the wall, because the speed of installing and using composer inside the wall is terrible.
2. How to translate, because laravel's documents are mostly in English. For example, laravel5.1 was released in December June. until December October 19, there were still no fully written documents.
3. How to crack the forces, you need to use TP people not to understand, use Yaf people's contempt, use Yii people's testing eyes
4. How to perform O & M? After the project is launched, you need redis memcache opcache php7 hhvm and other performance optimization solutions to solve the problem of low performance.

Above! First, I personally like laravel. However, I don't think laravel is necessary.
More ...... Well.
/*************************************** **************************************** ***/
Composer
It's just to make it easier for you not to duplicate the wheel, but it has nothing to do with laravel itself.
Laravel can only use composer. You can also use composer without laravel,
For example, CI3.0 supports composer, and you can use composer even without the framework.
The features of composer are irrelevant to those of laravel ......

Composer and laravel do not affect the freedom of your project code.

Is it true that when components related to core services and core data have bugs,
Do you have to wait for the composer version to update before fixing the BUG?
Of course not ......
In laravel, you cannot write include to introduce a file. Is it a new object?
Of course not ......

The existence of the Framework does not reduce the degree of freedom for writing code.
However, we provide you with a specification:
According to this specification, you can enjoy the benefits of this specification,
Naturally, it is bound to be subject to the constraints of the specifications and the disadvantages of the specifications.

/*************************************** **************************************** ***/
Repeating the wheel is not completely meaningless.
-- Even in work projects.

In many cases, the wheel that can be found is not suitable,
In this case, it is necessary to transform the wheel, or even redo the wheel.
This is normal, and there is no need to fear repeating the wheel.

Of course, we must evaluate the advantages and disadvantages of using old wheels, transforming old wheels, and redoing new wheels,
Weigh the pros and cons before making a decision.
/*************************************** **************************************** *****/
As @ justjavac said, LARAVEL's unit test concept is indeed good.
This is indeed a very attractive part of LARAVEL !!!
But if laravel supports PHP-FIG or JUnit, we need to support it.
We really need to look at different projects ......
Choosing a suitable framework for your project is more meaningful than focusing on a framework.

For large projects ......
How many PHP projects have existed for more than 5 years, with a single system maintenance staff of more than 100 people?
I don't think so much, do I?
I have very rare projects with a single system,
More are the projects where N small subsystems coexist.
If such a project removes the advantages of unit testing ......
How many advantages does LARAVEL have? It doesn't feel so obvious ......
[Of course, it may be because I have not been exposed to many large and medium-sized projects. ^_^]
/*************************************** **************************************** **********/
LARAVEL and CI give me the feeling:


CI3.0 is like a toolbox. I can easily find and use the required tools. Through tools in the toolbox, I can also work out many convenient tools for use.

LARAVEL is like a lathe. The speed of tools and manufacturing tools that can be manufactured by lathes is not comparable to that of toolboxes. However, if you want a lathe to create a tool in the toolbox, the effort required is not comparable to that of the Toolbox. I feel that your needs and capabilities and the value provided by Laravel are not very advanced in terms of Laravel's design philosophy. It is very suitable for applications of various development modes such as TDD, DDD, and BDD, as a framework, it prepares everything for you ~~ Composer is simply a php future. Without composer, PHP is bound to fall ~~
For new users, it is not very easy to get started, especially Laravel 5, but the learning value is very high ~~ If you want to know the latest programming thinking in the php industry, learn Laravel. LaraBase-home of Full-stack engineers In fact, many things are not complicated, and they are afraid of complicated theoretical content. A lot of things will happen once you think about them. Many people think that laravel is not a good framework. It is difficult and difficult. I can only say that laravel is indeed not a first-class and excellent framework. Laravel has a set of new php features, as well as various design patterns, Ioc containers, dependency injection, and so on. Laravel is a framework suitable for learning. It is very different from other framework ideas. It also requires you to be proficient in php and have a solid foundation. If you think laravel is difficult, only one reason is that your php infrastructure is not good enough.

In addition, if you are good at using namespaces and object-oriented features to search for something, you will find that it is so easy. There is a reason why everything exists. You can't beat it with a stick. You should take its length and make up for its short look at the routing and orm sections, and combine it with front-end backbone and so on, in addition, composer is a good thing. Concerning the efficiency issue, the running efficiency of web programs is never in the framework. In the database, the consumption of the framework is not a burden at all.

In addition, it is not entirely correct to ignore the framework consumption, when I used drupal for secondary development, a simple list page actually consumes more than 20 mb of memory for a single thread. The reason is that the drupal configuration is too complicated (not my configuration is complicated, but the system itself is complicated.) for the maximum degree of freedom of content configuration, all variables are inserted into the page. I went to stackoverflow and asked, and the answer is that this is normal in drupal .. Drupal is also a framework in general, but it only carries a cms system. Of course, such a system must be optimized externally for use ..

The laravel framework is quite good. It can be said that it is very comprehensive, and it is very happy to develop with phpstorm ..

Share two sets of teaching video, self from http://laracast.com Drag down one by one without subtitles ..
Laravel-whats-new link: Baidu cloud, please enter your password Password: 6cwy
Laravel-fundamentals link: enter the password to be extracted from Baidu cloud Password: aw2h

Another phpstorm experience is shared. If you use sublime or even zde to change phpstorm as soon as possible, you can say that sublime has functions, but there are also some advanced ide functions, in addition, even vim users should try it. phpstorm has plug-ins that can simulate vim operations and enjoy other benefits.
How-to-be-awesome-in-phpstorm link: enter the password to be extracted from Baidu cloud Password: hgga I have observed a phenomenon: developers who often find Laravel hard to learn and useless only use one language of PHP, or, developers who have no experience in static compilation languages (such as C/C ++/Java/Go) account for the vast majority.

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.