4 ms·
I think the choice of snake_case may be somewhat supported by empirical research[1, 2]. (The first link is a summary of the study.) No idea if the Rust designer
by lomnakkus 10y ago
I think the choice of snake_case may be somewhat supported by empirical research[1, 2]. (The first link is a summary of the study.) No idea if the Rust designers knew of this study.
[1] https://whathecode.wordpress.com/2013/02/16/camelcase-vs-underscores-revisited/ https://whathecode.wordpress.com/2013/02/16/camelcase-vs-und...
[2] www.cs.kent.edu/~jmaletic/papers/ICPC2010-CamelCaseUnderScoreClouds.pdf
- atombender 10y agoInteresting, thanks. Those studies seem to look at readability in isolation, but in my opinion the readability problem emergeces when combined with many other sources of "noise". Snakecase works perfectly fine in less noisy languages like Ruby and Python where there's little clutter in the first place. In a noisier language like Rust, camelcase would have helped give it more visual cohesiveness. That said, I'd love a programming font that could actually align the underscore with the font baseline. In all of today's fonts, the underscore breaks up the identifier into little pieces. Compare the vertical cohesiveness (not perfect, but closer) of: an⎽underscore⎽identifier with: an_underscore_identifier