Closed pjasiun closed 8 years ago
I'm not very happy that we'll be changing this, but I admit that lower case strings will be better. @oleq had the same case in the UI when a lowercased value could be used in the DOM directly, but it had to be transformed due to the current naming scheme.
So, +1.
Meh, on one hand I am for the current solution. Constants should be uppercase to differentiate from normal values that you can just pass as parameter. They mean that they are only limited number of options that you can pass. That feels much more natural.
But if it is going to make some problems (and I can imagine - i.e. trying to use part of the event name as a "constant" parameter will require using toUpperCase
, etc.) I am for having lowercase constants.
Just like @Reinmar mentioned, I'm for it.
But if it is going to make some problems (and I can imagine - i.e. trying to use part of the event name as a "constant" parameter will require using
toUpperCase
, etc.) I am for having lowercase constants.
It is not a matter of simply toUpperCase
. You have to change MY_CONST
to and back from myConst
.
Yeah, that's even worse. Let's go with lowercase constants then.
Some time ago we decided to resign using const definitions:
and use strings instead:
It seems to be a good decision. We decided then to use uppers case strings, what was natural choice.
The problem is we use lower case in events names, so there is:
change:children
event.This is why part of const, which is base of the event name, or the result of the event, already is lower (camel) case, see: https://github.com/ckeditor/ckeditor5-engine/blob/baa6825536a9e8647acbd8c2d0e6503dbf177d6b/src/model/document.js#L313-L322 or https://github.com/ckeditor/ckeditor5-engine/blob/baa6825536a9e8647acbd8c2d0e6503dbf177d6b/src/view/document.js#L273-L275
To avoid needless complications of our code and live we should agree to use the same conversion for event names and consts. They do not look that bad after all.