3 ms·
Camel notation looks awful with so many words. C++ style with underscores is way more readable.
by shmerl 13y ago
Camel notation looks awful with so many words. C++ style with underscores is way more readable.
- schrodinger 13y agoIt's just what you're used to. I'd say the opposite.
- jlgreco 13y agoSpaces between words got added to Latin over a thousand years ago. I figure there must be a reason that change occurred.
- veesahni 13y agosnake_case is 20% easier to read ( reference: http://bit.ly/11T1FWY http://bit.ly/11T1FWY )
- shmerl 13y agoI always thought it's rather self explanatory. Reading a text without distance between the words requires more effort. Capital letters don't help much for that. Underscore gives a space between the words, which allows more fluent reading.
- regularfry 13y agoIt might be self-explanatory, but there's a vast gulf between self-explanatory and correct.
- shmerl 13y agoIn this case it's not only correct, it's easy to test.
- philh 13y agoGlancing at the first page of that study, it looks like * People trained mostly in camelCase (also, nonprogrammers) read camelCase more accurately, but snake_case faster. (Previous study which I didn't follow up.) * People trained mostly in snake_case read both of them equally accurately, but snake_case faster. (But, grand total of fifteen participants.) (I find this mildly surprising: I seem to read snake_case slightly slower than normal text, and camelCase slightly faster, just based on the pauses between words. But camelCase would be easier to lose myself in. I find hyphenated-words easiest to read, but not many languages permit them...)
- angersock 13y agoThisIsMyClassType thisIsAnInstanceOfMyClass this_is_some_ruby_or_kernel_c_i_copied_from_stack_exchange _thisIsAFunctionParameterHavingBeenPassedIn THISISACONSTANTDONOTCHANGE THIS_IS_A_FRIENDLIER_ENUM _____how_many_spaces__in_this_var EDIT: Aaaand then there is the JS approach: http://mathiasbynens.be/notes/javascript-identifiers http://mathiasbynens.be/notes/javascript-identifiers