在快速原型设计时我应该关注代码质量吗?

发布于 2024-08-24 09:01:07 字数 1431 浏览 5 评论 0原文

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

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

发布评论

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

评论(5

秋千易 2024-08-31 09:01:07

回顾“原型”最终成为产品的次数,答案是肯定的。

不要忘记,您不仅是在对功能进行原型设计,还在对设计进行原型设计。

Looking back at the number of times a "prototype" ended up becoming the product, the answer would be yes.

Don't forget that you are not only prototyping the feature, you are also prototyping the design.

回忆躺在深渊里 2024-08-31 09:01:07

是的,质量。不进行优化。这个问题应该是社区维基。

Yes to quality. No to optimization. This question should be community wiki.

七七 2024-08-31 09:01:07

我会关注清晰度。

I would focus on clarity.

美人如玉 2024-08-31 09:01:07

如果质量和优化是原型的要求,那么可以。如果没有,那就不行。仅仅因为您正在进行快速原型设计,您就不会放弃标准操作程序,例如按照规范进行编程、使用源代码控制、测试等。快速开发原型对高性能的要求可能相对不寻常,但那是另一回事了。

If quality and optimisation are requirements for the prototype then yes. If not, then no. Just because you are doing rapid prototyping you don't abandon standard operating procedures like programming to a specification, using source code control, testing, etc. It is, perhaps, relatively unusual for high performance to be a requirement for a rapidly developed prototype, but that's another matter.

倒带 2024-08-31 09:01:07

是的。专注于质量、清晰度和简单性,并用注释来解释它的作用和原因(不要关心如何做,除非它真的很复杂,这就是代码的用途)。

我们在这里所做的几乎所有工作都是从“假设”开始的。如果有效,我们就会继续。

在编写代码之前,我们编写注释来描述应该发生的情况,然后编写代码以匹配注释。首先写下评论会迫使你思考如何构建这一切。我们发现它可以防止很多错误的假设,并且实际上使开发速度更快。

当您返回时,它还使重用变得更加容易 - 您不需要阅读代码并理解它,只需阅读注释即可。不要追求无意义的自我记录代码,所做的只是自我记录错误,您无需检查代码是否与注释/文档匹配。

您可以稍后担心优化 - 请参阅巨大胜利的描述 当我从事一个解析一些 Apache 日志文件的爱好项目时,我从 MFC CMaps 更改为 STL。这是在我的最初概念发挥作用之后完成的,只有当性能明显存在问题时才完成。

Yes. Focus on quality, clarity and simplicity AND comments to explain what its doing and why (don't bother with the how, unless its really complicated, that is what the code is for).

Just about all work we do here starts out as a what if? And if it works we continue with it.

We write comments that describe what should happen, before we write the code, then write the code to match the comments. Writing the comments first forces you to think about how you will structure it all. We've found that it prevents a lot of FALSE assumptions and actually makes development faster.

It also makes reusing this when you come back to it so much easier - you don't need to read the code and understand it, just read the comments. Don't go for the nonesense of self-documenting code, all that does is self-document the bugs, you've got nothing to check to see if the code matches the comments/documentation at all.

You can worry about optimization later - see this description of a huge win I got by changing from MFC CMaps to STL when working on a hobby project parsing some Apache log files. This was done after I had the initial concept working and only when it became apparent there was a problem with performance.

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