不对当前问题过度设计解决方案的原因

发布于 2024-07-25 06:57:56 字数 1432 浏览 12 评论 0原文

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

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

发布评论

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

评论(8

梦年海沫深 2024-08-01 06:57:56

维基百科上有很多充分的理由。

http://en.wikipedia.org/wiki/You_Ain%27t_Gonna_Need_It

  • 所花费的时间来自添加、测试或改进必要的内容
    功能。
  • 必须对新功能进行调试、记录和支持。
  • 任何新功能都会对未来可以做的事情施加限制,因此
    现在不必要的功能可能会阻止
    实现必要的功能
    稍后。
  • 在实际需要该功能之前,很难完全
    定义它应该做什么并测试
    它。 如果新功能不正常
    定义和测试,它可能不起作用
    是的,即使最终是这样
    需要。
  • 它会导致代码膨胀; 软件变得越来越大
    复杂。
  • 除非有规范和某种版本控制,否则
    功能可能不为人所知
    可以使用它的程序员。
  • 添加新功能可能会建议其他新功能。 如果这些新
    功能也已实现,这
    可能会导致滚雪球效应
    走向渐行渐远的特征主义。

另请参阅:http://en.wikipedia.org/wiki/KISS_principle

Plenty of good reasons on Wikipedia.

http://en.wikipedia.org/wiki/You_Ain%27t_Gonna_Need_It

  • The time spent is taken from adding, testing or improving necessary
    functionality.
  • The new features must be debugged, documented, and supported.
  • Any new feature imposes constraints on what can be done in the future, so
    an unnecessary feature now may prevent
    implementing a necessary feature
    later.
  • Until the feature is actually needed, it is difficult to fully
    define what it should do and to test
    it. If the new feature is not properly
    defined and tested, it may not work
    right, even if it eventually is
    needed.
  • It leads to code bloat; the software becomes larger and more
    complicated.
  • Unless there are specifications and some kind of revision control, the
    feature may not be known to
    programmers who could make use of it.
  • Adding the new feature may suggest other new features. If these new
    features are implemented as well, this
    may result in a snowball effect
    towards creeping featurism.

See also: http://en.wikipedia.org/wiki/KISS_principle

肤浅与狂妄 2024-08-01 06:57:56

特别是在嵌入式设备上,尺寸就是金钱(例如,较大的闪存部件,其成本更高并且在制造时具有更长的编程时间;或者更多的外围组件)。

即使在 Windows 应用程序上,应用程序越大、功能越多,开发成本就越高; 等到您知道需要什么、不需要什么时,您就会少得多地浪费金钱来开发那些根本不需要的东西。

此外,任何附加功能都可能带来错误。

在开发东西之前正确考虑需求是好事,但过度设计往往只是借麻烦。

Especially on an embedded device, size is money (larger Flash part, say, which costs more and has a longer programming time at manufacture; or more peripheral components).

Even on a Windows application, the larger your application and the more features it has, the more it costs to develop; wait until you know what's needed and what's not and you'll waste far less money developing stuff that turns out not to be what was needed at all.

Also, any additional functionality brings with it the potential for bugs.

It's good to think properly about the requirements before developing something, but over-designing is often just borrowing trouble.

眼眸里的快感 2024-08-01 06:57:56

他们:“我们可能会在未来的某个阶段在其他地方使用它。”

我:“是的,我们可能会。也可能不会。而且我们现在不知道我们可能想要以什么方式。如果我们确实想要在未来的某个阶段 - 那时我们会知道我们想要它的方式,那时我们就可以自信地编写它,但如果我们今天编写它,但从来不需要它,我们就浪费了资源来开发我们不需要的东西。增加了我们的代码膨胀,因此很难找到正在使用的代码库片段,因为我们(目前)所有这些不必要的代码挤占了有用的东西。”

Them: "We might use it somewhere else at some stage in the future."

Me: "Yes, we might. And we might not. And we can't know, now, in what ways we might want to. And if we do want it at some stage in the future - that's the time when we'll know the ways in which we want it. That's when we can write it with confidence. On the other hand, if we write it today, but never need it, we've wasted resources to develop something we didn't need. And we've added to our code bloat, so it's harder to find the pieces of our code base that are in use, because we've got all this (presently) unnecessary code crowding out the useful stuff."

假情假意假温柔 2024-08-01 06:57:56

在我们的团队中,我们只说“YAGNI”。 它提醒人们为什么。 如果您认为需要整理以提供报告,那么网络上有足够多的有关 YAGNI 的信息。

事实上,让我们团队中有人对你说“YAGNI”会有点伤人,因为这就像在说“来吧,你知道的比这更好”,这总是有点伤人。 :)

In our team we just say "YAGNI". It reminds people why. There is MORE than enough stuff on the web about YAGNI if you think you need to collate it to provide a report.

Actually, having someone say "YAGNI" to you on our team cuts a little because it's like saying "C'mon; you know better than that", which always hurts a little. :)

瞳孔里扚悲伤 2024-08-01 06:57:56

这是一种平衡,通常我只在成本低廉的情况下才会过度设计。 例如,我不会编写一个接受 2 个参数并将它们相加的函数,而是编写一个接受 n 个参数并将它们相加的函数。 但是,我编写一个采用 n 参数并使用汇编添加它们的函数。

It's a balance, as a rule I over design only where it's cheap to do so. For instance, I wouldn't write a function that takes in 2 parameters and adds them, instead I'd write a function that takes n-parameters and adds them. However, I don't write a function that takes n-parameters and adds them using assembly.

你与昨日 2024-08-01 06:57:56

你说

当您知道扩展设计对于现在或不久的将来存在的需求或可能的用途有意义时,我可以理解扩展设计。

我想有时人们会认为这条线是模糊的,对你来说“有意义”的东西可能对其他人来说是过度设计的。

You say

I can understand extending a design when you know it makes sense for requirements or possible uses that exist either right now or in the near future.

and I guess that sometimes people see this line as blurry something that "makes sense" to you may be over-design to someone else.

淡淡的优雅 2024-08-01 06:57:56

过度设计(以比需要更通用的方式解决问题)只有在您负担得起的情况下,特定的架构才是可接受的。

如果您接受无关的功能(通常来说,这与过度设计不同),您需要再次接受随之而来的成本(时间==>金钱)-如果您负担不起这些费用额外费用然后你就得到了答案:)

Overdesign (solving a problem in a way that is more generic than needed) a specific piece of architecture is acceptable only if you can afford it.

If you accept extraneous functionality (which is generally speaking different from overdesign) you need - again - to accept the costs that come with it (time ==> money) - if you can't afford those extra costs then you got your answer :)

手长情犹 2024-08-01 06:57:56

提供未来功能和添加未来功能之间存在很大差异。 一个好的设计应该有“钩子”或任何提供新功能或修改的东西。

有两种方法可以处理这种情况。 第一种方法是,如果他们是承包商并向您提供软件。 您可以简单地拒绝支付所有额外功能的费用,并对所需功能施加非常严格的期限。 如果他们错过了最后期限,那么你会为他们迟到的每一天处以经济处罚。

另一种方式是他们是否真的为你工作。 如果是这种情况,那么您可以摆脱他们或在他们的绩效评估中降级他们。

There's a big difference in providing for future functionality and adding future functionality. A good design should have the "hooks" or whatever to provide for new features or modifications.

There are two ways that you can possibly handle this situation. The first way is that if they are contractors and providing the software to you. You can simply refuse to pay for all of the extra functionality and impose very strict deadlines for your required functionality. If they miss the deadline then you impose financial penalties for every day they are late.

The other way is if they actually work for you. If this is the case then you can get rid of them or downgrade them in their performance reviews.

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