Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There is at least one study that supports snake case being more readable:

http://ieeexplore.ieee.org/xpl/articleDetails.jsp?reload=tru...



>One main difference is that subjects were trained mainly in the underscore style and were all programmers.

so in this study, where the subjects were trained in snake_case, they found snake_case was better.

and in the other study, where the subjects were trained in camelCase, they found camelCase was better.

I bet if we did another study of programmers who used kebab-case they'd find that kebab-case is better.

I don't think there's any reason to believe any particular case style is better than any other. personally I like snake_case and kebab-case because I find the word boundaries easier to recognize, but that's just a preference on my part. I have no idea if it's objectively better.


Yeah, none of the study results I've seen have been strong. I don't trust them all that much.

I prefer snake_case and believe it probably is mildly more readable than camelCase.

The underscore comes closer to space-delimited words like we use in English, typographically speaking. It's hard for me not to think that must be easier to read that way.

Obviously I can't prove it's better, but it both makes sense to me that it would be and fits with my subjective experience.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: