iancoleman / strcase

A golang package for converting to snake_case or CamelCase
MIT License
1.01k stars 105 forks source link

Incorrect naming for Camel & LowerCamel #38

Open ghostsquad opened 2 years ago

ghostsquad commented 2 years ago

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

hyacinthus commented 2 years ago

I also made a bug once because of this issue.

hyacinthus commented 2 years ago

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

tliron commented 2 years ago

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

ghostsquad commented 2 years ago

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

hlindberg commented 11 months ago

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

bobjackman commented 2 months ago

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.

tliron commented 2 months ago

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

bobjackman commented 2 months ago

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