不使用 PHP 框架的原因?

发布于 2024-11-06 08:58:11 字数 250 浏览 0 评论 0原文

我一直使用框架(Agile Toolkit)开发 Web 软件,它在所有情况下对我都有帮助,但有一个问题总是让我担心:

在什么情况下不建议使用框架?

因此,向其他经验丰富的框架开发人员提出一个问题 - 您什么时候会使用原始良好的 PHP 进行编码,而不是使用您的框架?框架的选择?

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:

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 PHP instead of your framework of choice?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浮华 2024-11-13 08:58:11

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

  • 通过自己编写,您会学到很多东西。我一直在自己工作,学到了很多以前不知道的关于 PHP 的不同知识。总的来说,这是一次很棒的学习经历,可以在面试或简历中使用。它表明您对这门语言非常感兴趣,最重要的是它背后的理论,而不仅仅是盲目的实现。
  • 框架中有很多你不需要的东西,通过制作你自己的框架,你只能得到你想要的东西。该框架是根据您自己的需求专门定制的。我不喜欢任何框架处理模板的方式,这是我创建自己的模板的最大触发因素。
  • 另外,我对此并不确定,但从逻辑上考虑......仅根据您的需求定制的您自己的框架将比任何其他框架快得多。考虑其他框架在加载时必须执行的所有设置以及涉及的数据库查询。您可以节省所有这些负载。
  • 如果您要制作一个不需要扩展的小项目,例如一个简单的投资组合网站,那么框架只会带来不必要的工作。

这里还有一篇非常好的文章介绍了其他细节。本文的作者首先讲述了他如何一直是框架的大力支持者。

http://jpst.it/jiYX

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

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

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

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.

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

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

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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文