包含时间戳和浮点值的类的命名建议?

发布于 2024-09-19 06:33:39 字数 261 浏览 6 评论 0原文

我需要命名这个结构:

struct NameNeeded
{
    DateTime timestamp;
    float value;
}

我将拥有这个结构的数组(时间序列)。 我想要一个简短且有暗示性的名字。这些数据是财务数据(Tick 不是一个好名字)。

我能想到的最好的一个是 DataPoint,但我觉得还有更好的一个:)

你会如何命名它?

I need to name this structure:

struct NameNeeded
{
    DateTime timestamp;
    float value;
}

I will have arrays of this struct (a time-series).
I'd like a short and suggestive name. The data is financial (and Tick is not a good name).

The best one I can think of is DataPoint, but I feel that a better one exists :)

How would you name it?

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

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

发布评论

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

评论(4

笑着哭最痛 2024-09-26 06:33:40

由于您有一个数据值和一个关联的时间戳,因此我脑海中首先浮现的是DataSample。我想象了一系列这些,就好像您正在对模拟信号进行数字采样一样(这两个值就像图表上的 x 和 y 坐标)。

Since you have a data value and an associated timestamp, the first thing that popped into my head was DataSample. I pictured a series of these, as if you were taking a digital sampling of an analog signal (the two values were like x- and y-coordinates on a graph).

温柔戏命师 2024-09-26 06:33:40

我的老科学家神经元告诉我这是一个测量。测量是与某些背景(时间、位置、实验条件等)相关的仪器读数。

脑海中浮现的另一个比喻是快照,或者是闪光灯照亮的不断变化的场景中的一个时刻——也许是一个瞬间。

My old scientist neurons are telling me that this is a Measurement. A measurement is an instrument reading associated with some context - time, position, experimental conditions, and so on.

The other metaphor that springs to mind is a Snapshot, or a moment in an evolving scene illuminated by a strobe light - an Instant, perhaps.

眼眸里的快感 2024-09-26 06:33:40

鉴于我们无法将特定概念与浮点值结构成员相关联,我们只能想到诸如“Value”、“Number”、“Float”或“Data”之类的模糊名称。

DateTime timestamp 成员向我建议名称应该具有与时间相关的后缀,例如“When”、“AtTime”、“Instant”或“Moment”

因此,组合这些名称片段,您可以得到

  • ValueWhen
  • ValueAtInstant
  • NumberWhen
  • DataAtTime
  • 等。

当遇到命名问题时,查阅字典或同义词库有时会有所帮助。很高兴看到精心选择的类型名称,并且很高兴想出它们 - 祝您的任务好运。

Given that we can't associate a specific concept with the float value structure member, only vague names such as "Value", "Number", "Float" or "Data" come to mind.

The DateTime timestamp member suggests to me that the name should have a time related suffix such as "When", "AtTime", "Instant" or "Moment"

So, combining these name fragments and you could have

  • ValueWhen
  • ValueAtInstant
  • NumberWhen
  • DataAtTime
  • etc.

When stuck on a naming problem, consulting a dictionary or thesaurus can sometimes help. It's pleasing to see well chosen type names, and gratifying to come up with them - good luck with your quest.

娇妻 2024-09-26 06:33:40

我个人会在名称中包含“Float”,以保留提供其他时间戳类型的可能性。例如,您可以提供带时间戳的 int 或 enum 以供分析师推荐。

如果您希望时间戳是隐式的,请考虑“FloatValue”。如果有一天其他属性可能加入时间戳(例如,数据源、置信度或不确定性),则使其隐式可能是可取的。

如果你想明确一点,一种可能是“RecordedFloat”。

I would personally include "Float" in the name, to leave open the possibility of providing other time-stamped types. For example, you could provide a timestamped int or enum for analyst recommendation.

If you want the time-stamping to be implicit, consider "FloatValue." Making it implicit might be desirable if other attributes might someday join the timestamp (e.g., source of data, confidence level, or uncertainty).

If you want to be explicit, one possibility would be "RecordedFloat."

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