开发者

Naming suggestion for a class containing a timestamp and a float value?

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).

开发者_如何学Python

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

How would you name it?


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.


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.


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."

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜