Empirical proof that underscores are good
-
i_have_always_preferred_this_style ToCamelOrPascalOne and now there is a study that confirms my point of view[^] :cool:
This study just consider normal people brain, they used "seven undergraduates" from second year, people that aren't programming for long time, if they even program instead of just frequent classes. I am coding for the last ten years, my neural network has adapted to read CamelOrPascal just as fast as this_mode. But nothing is faster than just space, there is only one way to read faster, is to read less.
-
loctrice wrote:
Isn't that title case ?
It's camel uppercase (or pascal / title case).
Regards, Nish
Blog: voidnish.wordpress.com Latest article: C++ 11 features in Visual C++ 2013 Preview
-
Loctrice is right: ThisIsTitleCase. thisIsCamelCase.
If you think 'goto' is evil, try writing an Assembly program without JMP.
TNCaver wrote:
ThisIsTitleCase. thisIsCamelCase.
Camel case has many variants. Pascal case is upper camel case. Title case is CamelCaps. See http://en.wikipedia.org/wiki/CamelCase[^]
Regards, Nish
Blog: voidnish.wordpress.com Latest article: C++ 11 features in Visual C++ 2013 Preview
-
TNCaver wrote:
ThisIsTitleCase. thisIsCamelCase.
Camel case has many variants. Pascal case is upper camel case. Title case is CamelCaps. See http://en.wikipedia.org/wiki/CamelCase[^]
Regards, Nish
Blog: voidnish.wordpress.com Latest article: C++ 11 features in Visual C++ 2013 Preview
So we're all correct. However, from that wiki, "Camel case may start with a capital or, especially in programming languages, with a lowercase letter." See also the article's named anchor #Current_usage_in_computing.
If you think 'goto' is evil, try writing an Assembly program without JMP.
-
So we're all correct. However, from that wiki, "Camel case may start with a capital or, especially in programming languages, with a lowercase letter." See also the article's named anchor #Current_usage_in_computing.
If you think 'goto' is evil, try writing an Assembly program without JMP.
Yeah typically I'd assume these : camelCase PascalCase (same as TitleCase).
Regards, Nish
Blog: voidnish.wordpress.com Latest article: C++ 11 features in Visual C++ 2013 Preview
-
Quote:
One main difference is that subjects were trained mainly in the underscore style and were all programmers. While results indicate no difference in accuracy between the two styles, subjects recognize identifiers in the underscore style more quickly.
[sarcasm] So its a non-biased study then? [/end sarcasm]
There's one of two conclusions that can be drawn: 1) They tried to improve on the previous study by making a biased study. (The phrase refers to their own study) 2) They tried to improve on a previous biased study. (The phrase refers to the previous study they are comparing and contrasting their own with).
-
i_have_always_preferred_this_style ToCamelOrPascalOne and now there is a study that confirms my point of view[^] :cool:
I find your lack of faith in camelCase and PascalCase disturbing...
CEO at: - Rafaga Systems - Para Facturas - Modern Components for the moment...
-
i_have_always_preferred_this_style ToCamelOrPascalOne and now there is a study that confirms my point of view[^] :cool:
-
Just in case (sic) you had wondered, the_underscore_style_of_naming_variables_etc is known as Snake Case.
Yes. It is used quite a bit in Python. (Seriously. It is.)
brisingr_aerowing@Gryphon-PC $ rake in_the_dough Raking in the dough brisingr_aerowing@Gryphon-PC $ make lots_of_money Making lots_of_money
-
i_have_always_preferred_this_style ToCamelOrPascalOne and now there is a study that confirms my point of view[^] :cool:
From the abstract: "subjects were trained mainly in the underscore style" ... ... which makes this study useless for determining which is better. And any proper study would have to accurately account for the cost of longer identifiers, which can make code layout more difficult, among other things.
-
Me? I used underScores. And I use pascal_case. And I use CamelCase. I also use Hungarian notation sometimes. I've found over the years and thousands of lines of code in many languages that there's NO ONE GOOD solution ... to just about any question. I do not, however, use tabs :)
How about we just simplify things and replace all these nasty and confusing concatenated word styles with something straight forward, like integer based identifiers.. Old:
int calculateFactorial(int num) /* or calculate_factorial() */
{
int value;
int i;value = 1;
for(i = 2; i < num; i++)
value *= i;return value;
}New:
int x9F37A170(int x00000001)
{
int x00000002;
int x00000003;x00000002 = 1;
for(x00000003 = 2; x00000003 < x00000001; x00000003++)
x00000002 *= x00000003;return x00000002;
}Now doesn't that just make things so much cleaner! :omg: And lets not forget the inherent localization benefits. :-D Of course, then there will be flame wars over whether to start it with a lower 'x' or an upper 'X', if the hex characters should be upper or lower, or do we use 32-bit identifiers or 64-bit. ;P