每次都用同样的方法,这在软件项目中有用吗?

发布于 2024-07-05 23:46:56 字数 1449 浏览 9 评论 0原文

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

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

发布评论

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

评论(2

·深蓝 2024-07-12 23:46:56

我建议进行一些小的修改,如果该方法已被证明可以正常工作(性能/维护/安全/等),那么每次都使用它。
诀窍是“被证明有效”,也是“正确”。
所以基本上,除非当前的方法有问题,否则不要为了改变而改变。 (请注意,一种方法被证明效果更好,实际上强调了另一种方法有问题,特别是效果不佳)。

特别是在我们的领域,它特别适用,因为当大多数代码以相同的方式构建时,您可以获得生产力/可扩展性的提高。 例如维护、开发人员培训等。

换句话来说,著名哲学家更熟悉的话:

如果它没有坏,就不要修理它。

I would suggest a small modification, if the method has been proven to work properly (performance/maintenance/security/etc.), THEN use that every time.
The trick is the "proven to work", and also the "properly".
So basically, unless there is a problem with the current method, don't change it for the sake of change. (Note that a method that works provably better, in actuality highlights that the other method has a problem, notably does not work as well).

Particularly in our field it is especially applicable, because of the productivity/scalability gains you get when most code is built the same way. E.g. maintenance, developer training, etc.

In other, more familiar words from the famed philosopher:

If it ain't broke, don't fix it.

幽蝶幻影 2024-07-12 23:46:56

嗯,我认为这绝对取决于。 如果您已经使用的方法具有良好的执行时间,(大部分)没有错误,并且按照您想要的方式工作,那么就不需要编写新的方法来完成此任务。 特别是如果您是为了金钱或公司而编程。

但是,如果您想学习编程语言的一些新功能,或者只是想学习一种不同的做事方式,完全出于您的个人兴趣,为什么不呢?

在丰田这样的公司中,节省时间和金钱至关重要。 然而,你的个人时间有你赋予它的重要性。 如果学习一种新的做事方法对你的盈利有好处,那就去做吧。 如果你的底线是尽可能多地学习,那么这可能是正确的做法。 另一方面,如果您的底线是尽快完成尽可能多的项目,那么事实并非如此。

然而,尝试不同的方法仍然可能有用,即使您的底线是节省时间和金钱; 因为,通过做一些你已经用不同的方法完成的事情可能会给你带来一些想法,从长远来看,这些想法可能会节省你的时间(时间就是金钱)。

所以我想说,如果你想以完全不同的方式重做某件事,那就去做吧。

Well, I think it absolutely depends. If the method you have already used has good execution time, is (mostly) free of bugs, and works just how you want, then there is no need to write a new way of doing this task. Especially if you are programming for money, or for a company.

However, if you are wanting to learn some new features of a programming language, or simply a different way of doing things, completely for you personal interest, why not?

In a company like Toyota, saving time and money is of utmost importance. However, your personal time has whatever importance you assign to it. If learning a new method of doing something is good for your bottom line then do it. If your bottom line is to learn as much as possible, then this is probably the right thing to do. If, on the other hand, your bottom line is to get as many projects done as fast as possible then it is not.

However, trying a different method could still be useful, even if your bottom line is to save time and money; because, by doing something you've already done with a different methodology may introduce ideas to you that could potentially save you time (and time is money) in the long run.

So I'd pretty much say, if redoing something in a completely different way is what you want to do, then just do it.

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