Re: [community-group] Toughts on the Use of "$" Prefix in the DTCG Token Standard (#240)

Thanks, @drwpow, for mentioning that the primary need for the "$" prefix derived from the necessity to **mark reserved object keys**. Also, thanks for adding the respective source from the JSON Schema spec, which I hadn’t considered. This brings the discussion in the right direction.

Maybe you can help me better understand a few parts of this specification. For example, at the bottom of [section 8](https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-01#section-8), it states:
> "While the "$" prefix is not formally reserved for the Core vocabulary, it is RECOMMENDED that extension keywords (in vocabularies or otherwise) begin with a character other than "$" to avoid possible future collisions."

If I understand this correctly, we have the following situation:
1. **"$" Prefix Not Formally Reserved**: The "$" prefix is not exclusively reserved for the core vocabulary, meaning that technically, you could use it for other purposes.
2. **Recommendation for Extension Keywords**: Despite the lack of formal reservation, it is recommended that any extension keywords (whether they are part of a custom vocabulary or otherwise) should not begin with the "$" character.
3. **Reason for the Recommendation**: The primary reason for this recommendation is to avoid possible future collisions. As the JSON Schema specification evolves, new core keywords prefixed with "$" might be introduced. If your custom keywords also use the "$" prefix, they could conflict with these future additions.

Am I understanding it wrong? Could anyone maybe provide even more technical clarification here?

And regarding one of the other comments:
> tokenGroupDescription is less readable than $description. You know, as a designer I see unnecessary words and clutter.

I still stick to my suggestion because, for me, it is less friction reading a longer variable name rather than having to resolve the abstraction for what the "$" prefix stands for. Also, keeping in mind how people read words, the order of characters doesn’t really matter as long as the first and last character are correct. This implies that reading speed is not significantly affected by the length of a word.


-- 
GitHub Notification of comment by DarioSoller
Please view or discuss this issue at https://github.com/design-tokens/community-group/issues/240#issuecomment-2379411259 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 27 September 2024 14:27:01 UTC