Although this question cannot be given the only correct answer, I very much hope to hear the opinions of people working with PHP frameworks.
For a long time and studied and wrote on Java / Android . Now again there is a need to use PHP . Last time I used PHP version 4. Now I'm trying to catch up.

Why has this question matured? When reading about PHP 5 + / 7 on the Internet, I often see references to PHP frameworks. And that's great, I thought. Until he began to stumble on two categories of opinions: some were happy with such opportunities, others saw this as a problem.

Naturally, all you need to try yourself, but I do not want to make a mistake many years ago, and ignore the opinions of other programmers. Fortunately, I have a head on my shoulders, and I can draw conclusions for myself from what has been said by other programmers. Somewhere do not agree, but somewhere to learn something new or start thinking in a direction that he did not even suspect.

In any case, the answer to this question will help to make an overall picture of those who are in the "tank", and increase the chances of learning PHP correctly.

Closed due to the fact that it is necessary to reformulate the question so that it was possible to give an objectively correct answer by the participants Dmitriy Simushev , Denis , HamSter , Bald , cheops 3 Oct '16 at 5:30 .

The question gives rise to endless debates and discussions based not on knowledge, but on opinions. To get an answer, rephrase your question so that it can be given an unambiguously correct answer, or delete the question altogether. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Determining whether a framework is needed is very simple. If you plan to use more than 10% of the framework functionality in your project, then it makes sense to use. But there is a nuance. Look at these 10% - do you REALLY want to shift them to the framework, or just simply finished off the list to the heap, trying to justify using the framework? - rjhdby

4 answers 4

Whether or not to use the framework is not related to php. This is a more general question.

First you need to solve one global issue - what is the framework and how does it differ from the library .

And now you can decide whether to use or not.

  • if the project is small-small, then frameworks are definitely not needed.
  • if you plan to write a project bike (for example, to practice some kind of features), then it is obvious that you do not need to use the framework, or at least not use the framework for cycling functions.
  • if you need to make a project quickly, then it is better to spend a little time, find a framework that solves the tasks of the project and use it. Otherwise, you still have to write these functions / classes, and this may take a lot of extra time. And a good solution would be to take a person who knows the found framework.
  • if you plan to do a big project, then it also makes sense to use the framework, but then in the future it is possible that it will be completely rewritten / boiled out.

When exactly you should not use the framework:

  • if you are doing homework in a university and your teacher does not know / does not like frameworks / libraries.
  • if you are doing a TK and it clearly says so.
  • if you understand that the project needs another (and one more) framework. In this case, either the initial framework was incorrectly selected, or you did not fully work out in the initial framework.
  • if the framework was released yesterday, and the number of questions and answers for SO on it is around zero.

    In my opinion, using frameworks simplifies code maintenance, a unified approach to the architecture and programming style, plus timely security fixes, plus timely optimization, and so on. Well, classical programming has not been canceled without this knowledge, not one framework will not help you (such people are just dissatisfied). So you will not lose anything, but only gain.

      If we are talking about projects that can / should be supported by third-party developers - it is better to use frameworks, the entry threshold will be lower. For small handlers / APIs, this approach is of course redundant. In general, it all depends on the task. But knowing at least one of the current frameworks at a level above the average is a must.

        Many things have already been thought through in frameworks that can be taken out of the box and used. For example, authorization, routing, work with database, form validation, and so on. If you start doing something from it yourself, firstly it will take a lot of time, secondly you can make mistakes. And in the framework you just take the required method and that's it.

        But because of their versatility, they are more cumbersome. If you need to make an advertizing one-page, then the framework is not needed. If you intend to develop a serious website, then using the framework, the application will be written faster and with its growth, it will be easier to manage the written code.