Patterns.dev
Patterns.dev

原始链接: https://www.patterns.dev/

我们对模式提供了一种现代视角。对于设计模式的一个常见批评是它们不必要地增加了复杂性。我们的观点是,模式对于解决特定问题很有价值,通常有助于向人类传达代码问题中的共性。如果一个项目没有这些问题,就没有必要应用它们。模式也可能非常依赖于语言或框架(例如 React),这通常意味着思考超越最初的 GoF 设计模式的范围。我们帮助您扩展 Web 应用程序的性能。了解用于更有效地加载代码的 Web 性能模式。不确定如何思考现代化的加载或渲染用户体验方法?我们为您提供支持。

patterns.dev网站,一个设计模式资源,正在收到对其Flyweight模式实现的反馈。Hacker News上的用户指出示例代码中可能存在缺陷。 具体来说,代码在添加书籍时使用了展开运算符,这创建了一个浅拷贝——实际上抵消了Flyweight模式旨在提供的内存节省优势。此外,示例添加了任意属性,进一步降低了模式的有效性。 尽管有这种批评,一位用户表达了对该资源的感谢,认为它对其当前需求有帮助。这场讨论强调了在使用设计模式时仔细实现的重要性,以确保它们能够带来预期的优势。
相关文章

原文

We offer a modern perspective on patterns

A common critique of design patterns is that they needlessly add complexity.

Our perspective is that patterns are valuable for solving specific problems, often helping to communicate comminalities in code problems for humans. If a project doesn't have those problems, there isn't a need to apply them. Patterns can also be very language or framework-specific (e.g. React), which can often mean thinking beyond the scope of just the original GoF design patterns.

We help you scale your webapps for performance

Learn about web performance patterns for loading your code more efficiently. Unsure how to think about modern approaches to loading or rendering user-experiences? We've got you covered.

联系我们 contact @ memedata.com