为什么我需要使用流行的框架? [英] Why do I need to use a popular framework?

查看:80
本文介绍了为什么我需要使用流行的框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我多年来一直是一名PHP开发人员,带着许多工具。我自己开发的工具,或者我已经学会信任的免费使用的解决方案。



我最近查看了CodeIgniter,发现它们有很多类和辅助例程来帮助开发,但在例子中我没有看到我无法像使用我自己的工具那样轻松完成任务。简单的事情,如数据库抽象,电子邮件帮助等。有一些有趣的代码与路线有关 - 将网址映射到正确的控制器;但即使这样,编写自己的代码也不是特别困难,如果你曾经用漂亮的URL编写MVC风格的Web应用程序。

即使浏览了其他一些流行的框架,我仍然没有看到任何可以节省时间的东西。即使在论坛上看到,我也看到人们努力获得工具为他们工作。我明白他们对初级开发人员会更有用,因为完整的系统设计技能需要一段时间才能完全理解和欣赏。然而,我经常被告知我应该使用现成的框架来生成我的解决方案,但我仍然不相信。对我这样的人来说真正的好处是什么?我只是精英主义者,还是这是一个普遍的观点?编辑:在这里看一些答案,我应该考虑打包我的工具集作为它自己的框架,编写一些文档和发布教程?如果我对采用其他框架犹豫不决,打开它并获得更多的目光有助于提高我自己的技能/工具? 解决方案框架有几个优点:


  • 您不必编写任何东西。在你的情况下,这不是一个帮助,因为你有你自己的框架,你已经积累了多年。

  • 框架提供标准化和经过测试的方式的东西。给定框架中的用户越多,遇到和编码的边缘案例就越多。你自己的代码可能会也可能不会以相同的方式进行战斗。 其他人可以招募到一个具有标准框架的项目中,并有权访问该框架的文档,示例和经验。您自己的摘录可能会或可能没有完整记录,或有使用的例子......但其他人最初不太可能使用它们。




编辑:

关于打包自己的框架的想法,清理公共消费的好处可以更大而不是让别人使用它的好处。



原因很简单:您必须重新评估您对每个组件的假设,它们如何组合以及如何清晰每件作品都能理解。一旦你发布了你的框架,你的成功将很大程度上取决于它的起步和运行的容易程度。

大的胜利是必不可少的,这些胜利将鼓励人们深入研究框架。 Ruby on Rails就是一个框架的例子,它能够毫不费力地给出如此巨大的胜利,然后隐藏了一些功能,这些功能可能会让某些人不知所措。 (RoR应用程序的质量问题不是关键,关键在于采用速度)。

在人们采用框架之后,它是关于容易继续使用。像一致的参数使用模式的细节在这里有所不同。如果一个类在每个方法上都有很多参数,而另一个类在调用方法之前有一个调用者需要调用,那么您将失去用户,因为他们无法获得特定情况下预期的感觉,而不诉诸于文件。



如果易于使用和易于生活并且问题得到妥善解决,您只需要让人们接受您的框架就很幸运。如果这些问题得不到妥善解决,即使对该框架的初步兴趣也会迅速减弱。原因在于有很多框架:您需要站出来获得让别人使用您的套件的好处(因为他们正确地对 框架保持警惕你是其他人)。


I've been a PHP developer for many years now, with many tools under my belt; tools that I've either developed myself, or free-to-use solutions that I have learned to trust.

I looked into CodeIgniter recently, and discovered that they have many classes and helper routines to aid with development, yet saw nothing in the examples that I couldn't do just as easily with my own tools. Simple things like DB abstractions, Email helpers, etc. There was some interesting code relating to routes - mapping urls to the right controllers; but even that's not particularly difficult to code yourself if you've ever written an MVC style web app with pretty urls.

Even after looking through some of the other popular frameworks, I still see nothing that would be that much of a time-saver. Even looking at the forums, I see people struggling to get the tools to work for them. I do understand how they would be more useful for junior developers, since full system design skills take a while to understand and appreciate fully.

Yet, I'm often told that I should use an off-the-shelf framework to produce my solutions, but I still remain unconvinced. What's the real benefit to someone like myself? Am I just being elitist, or is this a common opinion?

Edit: Looking at some of the answers here, should I perhaps consider packaging up my toolset as its very own framework, writing some documentation and posting tutorials? If I'm hesitant to take on other's frameworks, would opening it up and getting more eyes on it help to improve my own skills/tools?

解决方案

Frameworks have several advantages:

  • You don't have to write everything. In your case, this is less of a help because you have your own framework which you have accumulated over the years.

  • Frameworks provide standardized and tested ways of doing things. The more users there are of a given framework, the more edge cases that have been encountered and coded for. Your own code may, or may not, be battle hardened in the same way.

  • Others can be recruited onto a project with a standard framework and have access to the documentation, examples and experience with that framework. Your own snippets may or may not be fully documented or have examples of use... but isn't much chance that others are comfortable with them initially.

EDIT:

With regards to your idea of packaging up your own framework, the benefit of cleaning it up for public consumption can be larger than the benefit of getting others to use it.

The reason is simple: you will have to re-evaluate your assumptions about each component, how they fit together and how clear each piece is to understand. Once you publish your framework, your success will be strongly dependent on how easy it is to get up and running with.

Big wins with little effort are essential for adoption (those wins will encourage people to delve further into the framework). Ruby on Rails in an example of a framework that gives such big wins with little effort, and then has hidden layers of features that would have overwhelmed someone just getting started. (The question of the quality of RoR apps is not the point, the point is about adoption speed).

After people adopt a framework, it is about the ease of continued use. Little details like consistent parameter use patterns make all the difference here. If one class has many parameters on every method, while another has setters that are expected to be called before invoking methods, you will lose users because they can't get a "feel" for what is expected in a given case without resorting to the documents.

If both ease-of-adoption and ease-of-living-with issues are addressed properly, you only have to get lucky for people to adopt your framework. If those issues are not addressed properly, even an initial interest in the framework will wane quickly. The reason is that there are many frameworks: you will need to stand out to gain the advantages of having others using your kit (as they rightfully are as wary of your framework as you are of others).

这篇关于为什么我需要使用流行的框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆