Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

class is a keyword is several languageas #381

Open
rpatters1 opened this issue Feb 19, 2025 · 3 comments
Open

class is a keyword is several languageas #381

rpatters1 opened this issue Feb 19, 2025 · 3 comments

Comments

@rpatters1
Copy link

rpatters1 commented Feb 19, 2025

The MNX specification has several objects with a property called class. However, class is a reserved word in several languages, notably C++, Java, C#, and TypeScript. When MNX is mapped semantically to those languages, the most natural way of accessing the class property will not be available without extra effort, e.g., myInstance.class.

Furthermore, class has a number of meanings in programming so I'm not sure it is a great name anyway. I would suggest styleClass or cssClass instead.

@mscuthbert
Copy link
Contributor

agreed with this -- the use of class in HTML for CSS classes is one of the main reasons why working with React is such a pain, so let's try to avoid keywords that are reserved in many languages.

The one I often forget and use as a property is "default" which is reserved in so many languages.

"type" is reserved in Rust and Go, but I don't see those as primary languages for working with MNX at this time, and the word "type" is just so valuable for a property that I think we should feel free to use it.

@bhamblok
Copy link

bhamblok commented Feb 20, 2025

I wouldn't suggest to use the word "type" because in my mind it refers to "typecasting" values.
class would still stand if MNX would have remained an XML-standard, where it indeed reminds us a bit to HTML and where class could have been used for styling purposes.
However, since MNX has become a JSON-standard, class doesn't refer in any way to the styling of objects.
Neither do css or cssClass... Do we even have "cascading" of styles in MNX?
So why not just use style instead?

@williamclocksin
Copy link

williamclocksin commented Feb 20, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants