原文
| ||||||||||
| ||||||||||
![]() |
原始链接: https://news.ycombinator.com/item?id=43712280
Hacker News上关于“库模式:为什么框架是邪恶的”的讨论总结如下: 原文主张使用库而非框架。然而,评论者强调了框架的优势,尤其是在咨询或企业环境中。框架强制执行公共结构,使开发人员能够快速理解和参与不同的项目。这种结构对于顾问和客户来说非常宝贵,因为开发人员可以轻松地处理多项任务。 一位用户指出,框架在不需要优先考虑组件组合的Web服务中表现出色。框架强制执行编码标准,确保一致性并降低新开发人员的学习曲线,这与由各种库构建的复杂项目不同。另一位用户认为,框架就像操作系统一样,为组件之间的交互提供了必要的结构。 最后一条评论批评了文章具有点击诱导性的标题,提醒读者框架只是适用于某些特定情境而非所有情境的工具。
| ||||||||||
| ||||||||||
![]() |
However I work for customers, many different projects, and I'm more than happy to work with Ruby on Rails, that enforces a common structure to every project, lets me predict where files are and what they do, etc. The advantage is in all the time not spent on learning from scratch every single project. I can start working on the very first day. Even Django, which is mostly anarchy compared to Rails, is better than complete anarchy with every single project using different tools and having a different architecture.
Furthermore projects started with Sinatra and Flask and similar tools quickly evolve into something as complex as Rails and Django, with tons of home made fragile code. There is never the time to make them robust, because nobody is working full time on those projects for years. Basically frameworks allow developers to multitask among projects which is great for consultants and also for customers, because they don't have to pay for the extra developers.
reply