问题描述
我开始学习 Web 开发,现在我正在学习一些前端技能,现在我正在尝试使用 Bootstrap、Foundation、Semantic UI 等框架...但我已经有一个问题,一个应用程序可以使用两个框架吗?如果是这样,值得吗?如果没有,为什么?
i'm starting to learn about web development, by now i'm learning some front-end skills, by now i'm trying to use frameworks like Bootstrap, Foundation, Semantic UI, etc... but i've got a question, is it possible to use two frameworks for a single app? if so, is it worth? if not, Why?
关于框架的另一个问题是:使用框架来构建 Web 应用程序的前端是一种良好的做法吗?如果不是,为什么?构建前端的最佳实践方法是什么?
Another question about frameworks i have is: Is it good-practice to use a framework to build the front-end of a web app? if not, why? what's the best-practice method to build the front-end?
推荐答案
首先,当你提交一个前端库时,你通常会强加一个look &除了框架的编码风格之外,还可以感受应用程序.如果您尝试使用两个不同的框架(而且完全有可能),您最终可能会得到不一致的设计.
First of all, when you commit to a front-end library, you usually impose a look & feel on the application in addition to the framework's coding style. If you try to use two different frameworks (and it is at all possible), you will likely end up with an inconsistent design.
第二,当然(通常)可以使用多个框架,只要它们不相互干扰.但是,定义像 Bootstrap 或 Foundation(使用类)这样的前端框架的(好的)方法是有限的,因此您很可能会遇到一些干扰.附带说明一下,混合框架可能会给项目中的其他开发人员造成混淆.
Second of all, it is certainly (often) possible to use more than one framework, as long as they do not interfere with one another. However, there is a finite number of (good) ways to define a front-end framework like Bootstrap or Foundation (using classes), so you will very likely run into some interference. A side note is that mixing frameworks may cause confusion for other developers on the project.
结论:是的,您通常会发现可以组合两个(甚至更多)前端框架,但它们可能会干扰另一个框架并让您头疼,并且可能导致设计不一致.
In conclusion: Yes, you will usually find it possible to combine two (or even more) front-end frameworks, but they will likely interfere with another and cause you headaches, and it may lead to an inconsistent design.
作为一名 Web 开发爱好者,我的建议是尝试只使用一个框架,并在需要时将其他框架的点点滴滴添加到您的代码中 - 但不要尝试完全使用一个以上的框架.
My advice as a web developer hobbyist would be to try to commit to only one framework, and add bits and pieces into your code from other frameworks if you need them – but don't try to commit fully to more than one framework.
这篇关于在单个 Web 应用程序中使用两个或多个不同的前端框架是否正确?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!