Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
February 19, 2020 10:25 pm GMT

snake_case, camelCase, or dash-case?

So we've got snake_case and camelCase when it comes to code, and when it comes to filenames there's a third option we don't talk about as much because it's not usually available in code: dash-case. I've favored snake_case in both code and filenames for a long time because "it looks more like a space". And I do think that has a very real, practical benefit to readability, at least compared to camelCase. CamelCase, on the other hand, takes up one less column, which has a benefit in reducing the amount of line-wrapping needed, but I think that's much smaller.

Lately I've been starting to think more about speed. With filenames, dash-case is a keypress faster than snake_case. (CamelCase is also a keypress faster.) Typing a name one keypress faster doesn't matter so much in code, where you spend most of the time reading rather than typing, but for filenames, which you spend a lot more time typing, it's more significant. This might be convincing me to start using dash-case in filenames. I'm not sure yet.

So my question is: besides personal accustomization/stuff, does anyone have any other pros or cons to point out of any of the three options?


Original Link: https://dev.to/yujiri8/snakecase-camelcase-or-dash-case-c0a

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To