iancoleman/strcase

Incorrect naming for Camel & LowerCamel

Opened this issue · 9 comments

https://khalilstemmler.com/blogs/camel-case-snake-case-pascal-case/

Current CamelCase used in this library is actually supposed to be PascalCase
Current LowerCamelCase is should just be CamelCase

I also made a bug once because of this issue.

But it's too late to change the name for forward compatibility, so maybe highlight it in the comments file to emphasize it.

Also "LowerCamelCase" is often called "DromedaryCase", which has the advantage of being ten times cuter.

@tliron not really sure I agree that camelCase is "often" called "dromedaryCase".

https://trends.google.com/trends/explore?date=today%205-y&geo=US&q=PascalCase,DromedaryCase,CamelCase

image

image

However, happy to learn another term!

See nothing wrong with current naming, and change would break compatibility. Suggest closing this ticket (to save the next person some time when looking through the backlog).

It's true that changing it now would break backward compatibility (hence the suggestion to add a comment to the docs about it), but the claim that "nothing wrong with current naming" is a stretch -- while not technically wrong, the therm "lowerCamelCase" is so infinitesimally obscure it may as well be (Personally, this is the first time I've seen it in my entire 22 year career). PascalCase and camelCase are far and wide the industry accepted and widely used terms for this.

How about introducing aliases for various naming traditions? It would not break backwards compatibility.

Could do, but would have to use yet different terms since ToCamelCase() is already in use. (aliasing ToCamelCase() -> ToLowerCamelCase() would break current usages of ToCamelCase())

How about adding ToPascalCase() and just deprecate ToCamelCase()? Doesn't recommending more explicit terms, ToPascalCase() and ToLowerCamelCase() make sense?