《实用程序员》的作者忘记了 YAGNI 吗?

发布于 2024-09-12 06:27:56 字数 523 浏览 7 评论 0原文

务实程序员非常很多人推荐。我刚刚读完它,我明白为什么人们推荐它,尽管我会指出《Code Complete》更深入地涵盖了几乎所有相同的材料。

然而,让我烦恼的一件事是作者从未提到灵活性、概括性和为未来发展留出空间的任何缺点。这些概念都非常好,但是 YAGNI(你不会需要它)的原则发生了什么,它阻止了开发人员浪费时间来实现永远不会被使用的灵活性?

对 SO 的搜索显示了 400 个有关 YAGNI 的问题,所以我怀疑这个概念对作者来说太晦涩了。当然,我的经验远不如他们,那么为什么他们在整本书中没有提到任何限制的使用呢?

谢谢。

The Pragmatic Programmer is highly recommended by many people. I've just finished reading it, and I can see why people recommend it, although I would point out that Code Complete covers almost all of the same material in much more depth.

However, one thing that bugged me was the way the authors never mentioned any downsides of flexibility, generalising, and leaving room for future development. Those concepts are all very good, but what happened to the principle of YAGNI (You Ain't Gonna Need It), which prevents developers wasting their time implementing flexibility that's never going to be used?

A search of SO reveals 400 questions about YAGNI, so I doubt the concept was too obscure for the authors. I am, of course, nowhere near as experienced as them, so why didn't they mention any use of restraint throughout the book?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

﹉夏雨初晴づ 2024-09-19 06:27:56

他们不称之为 YAGNI,但第 11 页上有一个关键字至少具有相同的焦点:

知道何时停止!

They don't call it YAGNI, but there is keyword on page 11 that has at least the the same focus:

Know When to stop!

夜声 2024-09-19 06:27:56

他们没有忘记。我认为这本书早于 YAGNI 出名的时间。

They didn't forget. I think the book just predates YAGNI becoming well known.

土豪我们做朋友吧 2024-09-19 06:27:56

[YAGNI] 防止开发人员浪费时间实施
永远不会被使用的灵活性

实现灵活性并不一定需要更多时间。根据我的经验,它可以(并且应该)成为您自然编程风格的一部分。恕我直言,不灵活的代码通常是由于糟糕的编程实践造成的。

[YAGNI] prevents developers wasting their time implementing
flexibility that's never going to be used

Implementing flexibility doesn't necessarily take more time. In my experience it is something that can (and should) be part of your natural programming style. IMHO code that is inflexible is generally due to poor programming practices.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文