包含时间戳和浮点值的类的命名建议?
我需要命名这个结构:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
由于您有一个数据值和一个关联的时间戳,因此我脑海中首先浮现的是
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).我的老科学家神经元告诉我这是一个测量。测量是与某些背景(时间、位置、实验条件等)相关的仪器读数。
脑海中浮现的另一个比喻是快照,或者是闪光灯照亮的不断变化的场景中的一个时刻——也许是一个瞬间。
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.
鉴于我们无法将特定概念与浮点值结构成员相关联,我们只能想到诸如“Value”、“Number”、“Float”或“Data”之类的模糊名称。
DateTime timestamp
成员向我建议名称应该具有与时间相关的后缀,例如“When”、“AtTime”、“Instant”或“Moment”因此,组合这些名称片段,您可以得到
当遇到命名问题时,查阅字典或同义词库有时会有所帮助。很高兴看到精心选择的类型名称,并且很高兴想出它们 - 祝您的任务好运。
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
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.
我个人会在名称中包含“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."