3 ms·
I mix both: mainly using camelCase, but using underscores sometimes instead of conjunctions to make things more readable (as you say), especially to make some i
by jffhn 6y ago
I 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'