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:
I wonder just how much this is influenced by the fact that the english language is all lowercase by default, with very few exceptions. In german, Nouns are always uppercase, that means for a german speaker, a symbol based on german words would be more natural to read if each noun would start with an uppercase letter (e. g.
FeldIndex
), whereas an english speaker basing his symbol on english nouns would consider it more natural to read it all lowercase (e. g.array_index
). -
i_have_always_preferred_this_style ToCamelOrPascalOne and now there is a study that confirms my point of view[^] :cool:
-
Surely that's { } ?
Simon O'Riordan from UK wrote:
Surely that's
Stop calling me Shirley
-
Simon O'Riordan from UK wrote:
Surely that's
Stop calling me Shirley
Looks like I picked the wrong day to give up sniffing glue.....
-
Stop wanking and start doing real work! :zzz: Next you'll bother us about {} instead of { } I wonder if there ever was something more pointless? Maybe it's what you argue about when your work doesn't matter, I suppose?!
My programming get away... The Blog... DirectX for WinRT/C# since 2013! Taking over the world since 1371!
-
i_have_always_preferred_this_style ToCamelOrPascalOne and now there is a study that confirms my point of view[^] :cool:
Empirical study to prove that the person doing the study had no clue. Early in we find that they included programmers and non programmers in the study. Which raises the question, "Why would someone include an audience the code wasn't meant for?" I will give the person the benefit of the doubt that he didn't know any better. At the end of the day, it is for people. And there is benefit to having the code consistent. And there is benefit to having that consistent state follow that which is least annoying to the audience. (And here is a clue: said audience writes code.
-
i_have_always_preferred_this_style ToCamelOrPascalOne and now there is a study that confirms my point of view[^] :cool:
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 :)
-
Just in case (sic) you had wondered, the_underscore_style_of_naming_variables_etc is known as Snake Case.
-
i_have_always_preferred_this_style ToCamelOrPascalOne and now there is a study that confirms my point of view[^] :cool:
-
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