Are there any eye-tracking case studies, or similar research done to verify what code format is easiest to read, maintain and work with?
I always format my code the following way:
function thing()
{
if(something)
{
// do something
}
else
{
// do something else
}
}
However, I never see this followed elsewhere. In most APIs or open-source projects, it's done like this.
function thing() {
if(something) {
// do something
} else {
// do something else
}
}
Can you provide an answer that is not based upon your personal preference, but is supported by research or some kind of fact?
Has there been any visual eye-scanning studies done to confirm which format is best?
Before you close this, I think this question is valid cause it impacts the daily lives of so many programmers. ;)
– Reactgular May 07 '12 at 16:12http://www.amazon.com/White-Space-Your-Enemy-ebook/dp/B003L783VW
http://psychology.wichita.edu/surl/usabilitynews/62/whitespace.htm
– Jim In Texas May 07 '12 at 19:27