strcase icon indicating copy to clipboard operation
strcase copied to clipboard

Incorrect naming for Camel & LowerCamel

Open ghostsquad opened this issue 3 years ago • 9 comments
trafficstars

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

ghostsquad avatar Mar 31 '22 22:03 ghostsquad

I also made a bug once because of this issue.

hyacinthus avatar Apr 20 '22 03:04 hyacinthus

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

hyacinthus avatar Apr 20 '22 03:04 hyacinthus

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

tliron avatar Jun 25 '22 16:06 tliron

@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!

ghostsquad avatar Jun 26 '22 03:06 ghostsquad

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).

hlindberg avatar Sep 23 '23 09:09 hlindberg

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.

bobjackman avatar Jun 25 '24 16:06 bobjackman

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

tliron avatar Jun 25 '24 16:06 tliron

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())

bobjackman avatar Jun 25 '24 16:06 bobjackman

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

seiyab avatar Sep 21 '24 07:09 seiyab