“脏物体”一词是什么意思?

发布于 2024-08-11 20:50:26 字数 41 浏览 0 评论 0原文

我在编程中经常看到术语“脏”或“脏对象”。
这意味着什么?

I see the term "dirty" or "dirty objects" a lot in programming.
What does this mean?

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

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

发布评论

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

评论(2

谁人与我共长歌 2024-08-18 20:50:26

脏对象是其内容已更改的对象,但该内容尚未同步回数据库/磁盘。这是缓存和存储之间不同步的典型情况。

A dirty object is an object that has changed in its content, but this content has not been synchronized back into the database/disk. It's a typical situation of desynchronization between a cache and a storage.

旧人哭 2024-08-18 20:50:26

上下文:原始问题的措辞是我在“脏编程”中发现了很多,这个答案试图解决这个问题。接受的答案是关于脏对象、更改后的新问题以及明显不同的主题。


“编程脏”正如您所言引用它,可能意味着您通常使用“快速而肮脏”的方法来解决问题(已存档)在时间限制内,并希望稍后修复它。

脏编程通常与原型设计一起使用(即,显示概念原理的小程序,稍后将被实际产品替换),需要快速显示某些内容,但您的代码并不意味着持久和有效你希望它被扔掉(注意:在现实世界中,公司并不总是会杀死原型,从而导致肮脏的编程代码的维护噩梦)。

CONTEXT: original question was phrased as I find a lot in "programming dirty", this answer attempts to address that. The accepted answer is about dirty objects, the new question after it was changed, and a significantly different subject.


"Programming dirty" as you quote it, can mean that you use a "quick and dirty" method for solving a problem (archived), usually to stay within time constraints, and hoping to fix it later.

Programming dirty is often used with prototyping (i.e., a mini-program that shows the principles of a concept, later to be replaced by the actual product), where it is needed to show something quickly, but your code is not meant to last and you expect it to be thrown out (note: in the real world, companies don't always kill prototypes, leading to maintenance nightmares of the dirtily programmed code).

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