原型设计时的最佳实践?

发布于 2024-07-13 15:16:46 字数 178 浏览 7 评论 0原文

在制作原型时,您在多大程度上抛弃了最佳实践,转而采用代码和修复黑客攻击? 当然,该代码并不打算保留在完整的生产环境中。

添加:我正在开发一个用 Python 制作的相当大的半工作原型,以找出嵌入式应用程序的 UI。 我知道这些代码并不打算在生产中使用,但仍然让我烦恼的是,代码库的质量随着所做的更改数量而稳步下降。

While prototyping, to what extent do you throw best practices out of the door in favor of code-and-fix hacking? Granted that the code is not intended to be kept in full production.

Add: I am working on a rather large semi-working prototype made in Python, to figure out the UI for an embedded application. I know that the code is not intended to be used in production, but still it annoys me that the quality of the code base declines steadily with the number of changes done.

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

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

发布评论

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

评论(5

最偏执的依靠 2024-07-20 15:16:46

不幸的是,由于时间限制,我已经将太多原型变成了基准产品。 因此,理想情况下,您将遵循最佳实践。 实际上,您会尽一切努力完成工作,以便在您设定的最后期限内完成任务。 不要指望有机会完全重写。 您提出的内容通常会成为基线,尤其是如果需要花费几天以上的时间来开发的话。 最好的建议是学习以黑客级别的速度使用最佳实践。

Unfortunately, I have had too many prototypes turn into the baseline product due to time constraints. So ideally, you'll follow best practices. Realistically, you do what it takes to get the job done in order to meet whatever deadline you are shooting for. Don't expect the opportunity to completely rewrite. What you come up with will frequently be the baseline, especially if it took more than a few days to develop. The best advice is to learn to use best practices at hacker level speeds.

歌枕肩 2024-07-20 15:16:46

这取决于您的原型想要证明什么。 您是在设计 UI 原型以提高可用性并向客户演示,还是在设计架构原型?

如果我正在制作 UI 原型,那么一旦概念经过迭代并得到验证,我就会扔掉所有东西。

如果我正在构建一个架构原型,那么最终的代码将符合最佳实践并且可用。

也就是说,由于时间或预算的限制,最终投入全面生产的黑客工作原型的数量令人惊讶。 如果您的目的是让代码不最终投入生产(即 UI 原型),那么模拟屏幕截图而不是对其进行编码会很有用。

It depends upon what your prototype is trying to prove. Are you prototyping the UI for usability and to demonstrate to clients or are you prototyping an architecture?

If I'm prototyping a UI then I'll throw away everything once the concept has been through iterations and proven.

If I'm prototyping an architecture then the final code will conform to best practices and be usable.

That said, it's amazing the amount of hack job prototypes that end up in full production due to time or budget constraints. If your intention is for the code to not end up in production (ie a UI prototype) then it can be useful to mock up screenshots rather than code them.

无人问我粥可暖 2024-07-20 15:16:46

我抛弃了“干净”的方法和注释(即“让事情发生”的实用程序类),但如果你愿意的话,我不会抛弃“业务对象”。

例如,如果我可以选择定义一个“Car”类来定义“WheelCount”、“DoorCount”的字符串值属性,或者只是创建一个快速哈希表,那么我通常会继续并花费一些额外的时间来创建汽车类。

这样做的原因是因为当我稍后回去重新编码时,查看真实的类名更有意义(有时这些小类可以转移到“真实”版本)。

一般而言,原型设计中最大的危险是想“我稍后会修复它”,然后不这样做......所以如果在任何时候你在脑海中想到“我对如何完成这门课有一个很好的想法” ”,继续在该类上多花几分钟并正确完成,以便您可以重复使用它。

I throw out 'clean' methods and commenting (i.e. utility classes that 'make things happen'), but not "business objects" if you will.

So for example, if I have the choice between defining a "Car" class to define string value properties of "WheelCount", "DoorCount", or just making a quick Hashtable, I'll generally go ahead and spend a little extra time creating the Car class.

The reason for this is because when I go back to re-code it later, it makes more sense to look at real class names (and sometimes these little classes are transferable to the 'real' version).

The biggest danger in prototyping in general is thinking "I'll fix it later" and then not doing it... so if at ANY point you think in your mind "I have a pretty good idea about how I need to do this class", go ahead and spend a few extra minutes on that class and do it right so you can re-use it.

若能看破又如何 2024-07-20 15:16:46

我几乎总是将原型(此处称为“尖峰”)视为一次性代码。 原型的目的是理解问题,而不是解决问题。 这种理解比任何代码制品都重要得多,并且正确实施解决方案应该是微不足道的(如果不是,我会认为峰值的范围太大)。

您可以将原型重构为适合的状态,但根据我的经验,考虑到它必须与更广泛的系统集成,从头开始重写会更快。

I almost always treat prototypes (referred to as "spikes" round here) as throwaway code. The point of a prototype is to gain understanding of a problem, not to solve it. That understanding is far more important than any code artefacts, and implementing the solution correctly should be trivial (if it is not, I would argue the scope of the spike is too large).

You could refactor the prototype into a fit state, but in my experience it is faster to rewrite from scratch, given that it has to integrate with a wider system.

夏九 2024-07-20 15:16:46

对于原型来说,只有外观才是真正重要的。 如果你有足够的勇气事后扔掉代码,你可以使用书中的任何肮脏技巧,只要它看起来很棒。

请记住,原型只是获得客户响应的工具。 (是的,我喜欢它,或者,你为什么把这个选项放在那里?)。

For a prototype, only the outside is really important. If you are brave enough to throw away the code afterwards, you can use any dirty trick in the book as long as it looks great.

Remember, a prototype is just a tool to get a customer response. (Yeah I like it, or, why have you put that option there?).

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