javascript框架
Picking your JavaScript framework is a difficult decision. There are many considerations that need to be made when choosing which JavaScript framework is best for you. These are the considerations I judge each JavaScript framework by before committing to it for a project (or all of them).
选择您JavaScript框架是一个艰难的决定。 选择最适合您JavaScript框架时,需要考虑许多因素。 这些是我在为项目(或所有项目)提交之前要判断每个JavaScript框架的考虑因素。
它能满足您的需求吗? (Does it do what YOU need it to?)
This may seem obvious but there's always a temptation to fall in love with the cool features of a JavaScript framework before confirming that the framework provides the functionality needed for the upcoming project. Have a list of functionality you need and stick to it.
这似乎很明显,但是在确认该框架提供了即将到来的项目所需的功能之前,总是有一种爱上JavaScript框架的酷功能的诱惑。 列出所需的功能并坚持使用。
代码有多快? (How fast is the code?)
Users expect accuracy, users want speed. No matter how cool your design, content, or JavaScript effect may be, if your website is slow, your user is gone. You will need for the basic functions to be as fast as possible so that your own code can run quickly. Don't know how fast each framework is? You can always see the most up to date versions of each framework run at the MooTools Slickspeed page. Run at least five tests before concluding which is faster.
用户期望准确性,用户希望速度。 无论您的设计,内容或JavaScript效果多么酷,如果您的网站运行缓慢,那么您的用户就不见了。 您需要使基本功能尽可能快,以便您自己的代码可以快速运行。 不知道每个框架有多快? 您始终可以在MooTools Slickspeed页面上看到运行的每个框架的最新版本。 在确定哪个更快之前,请至少运行五个测试。
框架有多大(文件大小)? (How large (file size) is the framework?)
It will be important that the file size is small on two fronts: you will want the JavaScript to be a quick download for the user and you will need to worry about bandwidth if your site is popular. There are many tools to compress your JavaScript; I recommend Dean Edwards' Packer.
重要的是,文件的大小在两个方面要小:您希望JavaScript是对用户的快速下载,并且如果您的网站很受欢迎,您将需要担心带宽。 有很多工具可用来压缩JavaScript。 我推荐Dean Edwards的Packer。
有足够的文件吗? (Is there adequate documentation?)
One issue that has plagued JavaScript frameworks for a few years is that they haven't been documented well (if at all). Prototype seemed to be the most used and highly-regarded frameworks a year ago but Prototype offered little documentation. Each framework now provides more documentation, but make sure the documentation is adequate for your purposes.
困扰JavaScript框架几年的一个问题是,对它们的记录还不够好(如果有的话)。 原型似乎是一年前使用最多且备受推崇的框架,但是原型几乎没有提供任何文档。 每个框架现在都提供了更多文档,但是请确保该文档足以满足您的目的。
社区有多活跃? (How active is the community?)
One of the best parts of any free, open source software is the community. The community is extremely important within the JavaScript community. The community provides help, code examples, and suggestions for the framework and others using the framework. Be sure to check out the community before you choose your framework.
社区是任何免费开放源软件中最好的部分之一。 在JavaScript社区中,社区非常重要。 社区为框架和其他使用框架的人员提供帮助,代码示例和建议。 选择框架之前,请务必先查看社区。
代码的模块化程度如何? (How modular is the code?)
Frameworks can often get quite large in file size and its likely that you don't need all of the code. A good framework will keep the code modular so that you can pick which functionalities you need.
框架通常会变得非常大,并且文件可能不需要所有代码。 一个好的框架将使代码保持模块化,以便您可以选择所需的功能。
哪些专业网站使用该框架? (Which professional websites use the framework?)
A few of the frameworks are being used by some recognizable websites and business. For example, Digg and Apple use Prototype/Scipt.aclo.us, cNet and GameSpot use MooTools, and WordPress uses jQuery. Big company support can show the maturity of a framework.
一些知名网站和企业正在使用一些框架。 例如,Digg和Apple使用Prototype / Scipt.aclo.us,cNet和GameSpot使用MooTools,而WordPress使用jQuery。 大公司的支持可以显示框架的成熟度。
它可以为您节省多少时间(代码可以保留多长时间)? (How much time does it save you (how short can the code be)?)
A major benefit to using a JavaScript framework is that they provide code structures to allow you to do what every programmer would love: code less, do more. Look for your framework to allow you to chain functionality to allow maximum functionality with as little code as possible.
使用JavaScript框架的主要好处是它们提供了代码结构,使您可以做每个程序员都想做的事情: 减少代码编写,做更多事情 。 寻找您的框架以允许您链接功能,以使用尽可能少的代码获得最大的功能。
翻译自: https://davidwalsh.name/javascript-framework-considerations
javascript框架