-
Notifications
You must be signed in to change notification settings - Fork 19
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
Comments
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. |
I wouldn't suggest to use the word "type" because in my mind it refers to "typecasting" values. |
Also, ‘type’ is a keyword in Scala. I have been translating my music notation program into Scala, so have become more familiar with that peculiar language. I read/write my own music data interchange language based on Lisp, which I find more efficient and faster than JSON, but will aim to also use MNX in due course. On 20 Feb 2025, at 13:16, Bob Hamblok ♫ ***@***.***> wrote:
I wouldn't suggest to use the word "type" because in my mind it refers to "typecasting" of a 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?—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
bhamblok left a comment (w3c/mnx#381)
I wouldn't suggest to use the word "type" because in my mind it refers to "typecasting" of a 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?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
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 theclass
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 suggeststyleClass
orcssClass
instead.The text was updated successfully, but these errors were encountered: