3 ms·
I've come to appreciate snake case (or hyphenated words in languages like Clojure) because it adds a little extra space in the syntax, and this break is easier
by hellofunk 6y ago
I've come to appreciate snake case (or hyphenated words in languages like Clojure) because it adds a little extra space in the syntax, and this break is easier to read I think. Long camelCased phrases are often really dense.
- lonelappde 6y agoUnfortunately it makes it hard to see that the word is one word, since many apps draw underscores wrong and because people use (ugh) monospace and even proportional fonts make underscores wider than space. For programming underscore should be narrower than space.
- Rainymood 6y agoPersonally going to Javascript from Python I actually am starting to prefer camelCase over snake_case, compare LongFunctionVariableFactoryDesigner vs long_function_variable_factory_designer, saves 4 spaces. This is all subjective of course... maybe I've been writing too much Javascript
- jffhn 6y agoI mix both: mainly using camelCase, but using underscores sometimes instead of conjunctions to make things more readable (as you say), especially to make some important meta information stand out (as in "doSomething_locked()" for a method, to indicate that it must be called within some contextual lock). If using mainly underscores, I don't see what other separator I could use as a higher level separation. Maybe two underscores, but that could too easily be seen as a typo.
- stronglikedan 6y agoUnderscores to separate words, and dashes to separate clauses. E.g., 'do_something-locked()'. I personally don't use this style in code, but it's my go-to file naming convention to avoid whitespace. E.g., 'my_awesome_report-20200428.pdf'