FDSN / SeedLink

https://docs.fdsn.org/projects/seedlink/
Creative Commons Zero v1.0 Universal
1 stars 1 forks source link

replace magic numbers with text #43

Closed crotwell closed 9 months ago

crotwell commented 10 months ago

Use of magic numbers, -1 and -2, in DATA commands is more confusing than a string with meaning.

Propose replacing DATA -1 with DATA LATEST and DATA -2 with DATA EARLIEST or the undocumented DATA ALL from version 3.

I am open to different command text, but feel that magic numbers should be avoided due to the possibility of math causing users to accidentally trigger them. The <seq> should always be a positive integer or a meaningful text string.

See issues #9 for related comments.

crotwell commented 10 months ago

@andres-h do you feel strongly about using -1 and -2 instead of a non-numeric text for these special values? Would you prefer to keep DATA ALL from the previous version?

andres-h commented 10 months ago

@andres-h do you feel strongly about using -1 and -2 instead of a non-numeric text for these special values?

No, not at all.

We discussed in #9 whether -1 should give the latest (already existing) data packet or next (not yet existing) and even though I tended to prefer "latest", we decided "next", because otherwise using -1 repeatedly (for whatever reason) may return the same packet multiple times. So NEXT would be probably better than LATEST.

EARLIEST may be ambiguous if you consider the possibility of out-of-order data.

crotwell commented 10 months ago

+1 for using DATA NEXT.

How about using DATA ALL instead of DATA -2?

andres-h commented 10 months ago

How about using DATA ALL instead of DATA -2?

I'm OK with it.

crotwell commented 10 months ago

OK, please update to NEXT and ALL when you get a chance.