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

DarioSoller has just created a new issue for https://github.com/design-tokens/community-group:

== Toughts on the Use of "$" Prefix in the DTCG Token Standard ==
First, I want to express my appreciation for the tremendous effort and dedication that has gone into developing the new DTCG token standard. The work being done here is invaluable to the design and development community, and I am grateful for the opportunity to contribute my thoughts.

As a lead frontend engineer and design system solution architect, I have a deep appreciation for clean code craftsmanship and the importance of maintainable and speakable code. With this in mind, I have some concerns regarding the decision to prefix relevant properties of the design token data object with the "$" character:

- **Historical Context**: The use of the "$" prefix can be reminiscent of older practices, such as those seen in jQuery, which may not align with modern coding standards and practices. Additionally, this prefix has been used in other contexts, such as RxJS observables, which has led to some confusion and mixed opinions within the developer community.
- **Modern Practices**: Other types of prefixes, such as those used for marking private variables with an "_" underscore prefix, are also considered bad practice nowadays. With the support of modern IDEs being so advanced, there is no longer a need for such conventions.
- **Adoption and Effort**: I am well aware that some tools have already started adopting the standard with the "$" prefix, and I understand the significant amount of effort that would be required to change this at this stage. However, I could not find any discussion around this specific kind of prefix in the available documentation and community discussions.
- **Collision Prevention**: I recognize that the prefixes with a dollar sign ($) are intended to help prevent collisions with token names. Using this prefix eliminates the need for a reserved words list and helps future-proof the specification. However, I wonder if this is truly the only way to mark properties, aside from using a reserved word list. Could there be alternative approaches that might achieve the same goals without the drawbacks associated with the "$" prefix?
- **Type Definition Package**: Moreover, an official type definition package would be a really nice addition to the standard, which might have already been discussed. This could further enhance the usability and integration of the standard across various tools and platforms.

I apologize if my feedback comes at a late stage in the process, but I felt it was important to share my perspective. I am eager to hear the thoughts of others on this matter and to engage in a constructive discussion about potential alternatives.

Thank you once again for your hard work and for considering my input.

Please view or discuss this issue at https://github.com/design-tokens/community-group/issues/240 using your GitHub account


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

Received on Tuesday, 13 August 2024 09:03:28 UTC