An Interest In:
Web News this Week
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
- March 26, 2024
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
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To