不使用 PHP 框架的原因?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5925356/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 22:54:38  来源:igfitidea点击:

Reasons to NOT use a PHP Framework?

phpframeworksatk4

提问by romaninsh

I have always developed web software using a framework (Agile Toolkit) and it was helpful to me in all situations, but one question always concerned me:

我一直使用框架 ( Agile Toolkit)开发 Web 软件,它在所有情况下对我都有帮助,但有一个问题始终困扰着我:

In which circumstances it's NOT advisable to use a framework?

在哪些情况下不建议使用框架?

So a question to other veteran framework developers - when would you code in a raw good PHPinstead of your framework of choice?

因此,向其他资深框架开发人员提出一个问题 - 您什么时候会使用 araw good PHP而不是您选择的框架进行编码?

回答by Flipper

There are many reasons that people will suggest not to use a framework.

人们建议不要使用框架的原因有很多。

  • You will learn a lot by writing your own. I have been working on my own and I have learned a lot of different things about PHP that I did not know before. Overall it is a great learning experience that can be used in an interview or on your resume. It shows that you have a big interest in the language and most importantly the theory behind it rather than just the mindless implementation.
  • There are a lot of things in frameworks that you do not need and by making your own you can get only whatever you want. The framework is tailored to your own needs specifically. I for one did not like how any of the frameworks handled templates which was the biggest trigger for me to make my own.
  • Also, I am not positively sure about this one, but thinking of it logically...your own framework that is tailored to only your needs will be much faster than any of the other frameworks. Think about all of the settings that the other frameworks have to go through when loading and the database queries that involves. You save yourself all of that loading.
  • If you are going to be making a small project that will not need to be expanded on, such as a simple portfolio website, then a framework would just be more work than necessary.
  • 通过自己编写,您将学到很多东西。我一直在独立工作,并且学到了很多我以前不知道的关于 PHP 的不同东西。总的来说,这是一次很棒的学习体验,可以在面试或简历中使用。它表明你对这门语言非常感兴趣,最重要的是它背后的理论,而不仅仅是盲目的实现。
  • 框架中有很多你不需要的东西,通过制作自己的框架,你只能得到你想要的东西。该框架专门针对您自己的需求量身定制。我个人不喜欢任何框架处理模板的方式,这是我制作自己的模板的最大诱因。
  • 另外,我对这个不是很确定,但从逻辑上考虑……你自己的框架只为你的需求量身定做,比任何其他框架都要快得多。考虑其他框架在加载和涉及的数据库查询时必须经历的所有设置。您可以省去所有的负担。
  • 如果您要制作一个不需要扩展的小项目,例如一个简单的投资组合网站,那么框架将是不必要的工作。

There is also a very good article here that goes into other details. The author of this article starts out by talking about how he always was such a big proponent of frameworks.

这里还有一篇很好的文章,详细介绍了其他细节。这篇文章的作者首先谈到他如何一直是框架的大力支持者。

http://jpst.it/jiYX

http://jpst.it/jiYX

I am always going to push towards making my own frameworks unless I start doing some freelance work. I am constantly updating my framework and learning more and more. You will never hear anybody say definitely use or definitely do not use a framework because it all depends on the use.

除非我开始做一些自由职业,否则我总是会努力制作自己的框架。我不断地更新我的框架并且学习越来越多。您永远不会听到有人说肯定使用或绝对不使用框架,因为这完全取决于用途。

Edit:There is also a question over at the Programmers site on this: https://softwareengineering.stackexchange.com/questions/49488/when-not-to-use-a-framework

编辑:程序员网站上还有一个问题:https: //softwareengineering.stackexchange.com/questions/49488/when-not-to-use-a-framework

Edit #2:One last article about why frameworks are not necessary: http://www.amberweinberg.com/you-dont-need-a-framework-if-you-have-a-good-developer/

编辑 #2:关于为什么不需要框架的最后一篇文章:http: //www.amberweinberg.com/you-dont-need-a-framework-if-you-have-a-good-developer/

回答by mr_eclair