A programming idiom is a means of expressing a recurring construct in
one or more programming languages.
Is that a construct, recurring frequently enough to justify being its "own thing"? Does it qualify to be an idiom by definition?
Even though the question is tagged as C
, it does seem like this is purely an Objective-C thing in a few APIs, and neither the language nor the particular APIs strike as exemplary. It serves the simple purpose of providing a unique arbitrary value, a form of lazy enumeration when you don't really care about the key value. Should that be an idiom?
I think not, and it is not my personal preference but simple logic. It is rare and insignificant, basically it is a value in memory which happens to be equal to its address in memory. It deserves as much having its own name as an integer in an array with value equal to its index in the array does.
Furthermore, not having any standardized name for it, this question automatically turns into a "primarily opinion based" one, which is against SO guidelines, on top of not being related to a programming problem in the first place. It is not a "specific programming problem", it is not a "practical, answerable problem that is unique to software development" as not having its own name is in no way problematic to its use, it is a topic for discussion in a discussion board for programmers. It has a place here on SO as much as a question "How should I name my variable?" and I don't mean coding conventions, ultimately, that's what the question is about, how to name a macro... and pretty much anything at least vaguely related to its usage intent will beat DECLARE_VOID_THING
, like say a UNIQUE_HANDLE
, and there is no need for it to be or make it an idiom to solve that "problem", and lastly - there is no idiom to name here.