A programming idiom is a means of expressing a repeating construct in one or more programming languages.
Is this a construction that is repeated often enough to justify its "own"? Does he have the right to be an idiom by definition?
Although the question is marked as C , it seems that this is just an Objective-C thing in several APIs, and neither the language nor the individual APIs are exemplary. It serves the simple purpose of providing a unique arbitrary value, a form of lazy enumeration when the key value really is not important to you. Should there be an idiom?
I think not, and this is not my personal preference, but simple logic. This is a rarity and insignificant, mainly this value in memory, which turns out to be equal to its address in memory. It deserves to have its own name as an integer in an array with a value equal to its index in the array.
In addition, if he does not have a standardized name, this question automatically turns into “opinion-based”, which contradicts SO recommendations, in addition to being not primarily related to the programming problem. This is not a "specific programming problem", it is not a "practical, answering problem unique to software development", since the absence of a proper name is in no way problematic for its use, this is a topic for discussion in a discussion for programmers. It takes place here on SO in the same way as the question “ How do I name my variable? ” And I don’t mean the coding agreement, in the final analysis, what it is about, how to name the macro .. . and almost everything that is at least vaguely connected with its intentions to use will surpass DECLARE_VOID_THING , for example say a UNIQUE_HANDLE , and there is no need for it to be or make an idiom to solve this "problem", and finally here no idiom.
dtech source share