patternMinor
Which is easier for human perception: type of variable before or after its name?
Viewed 0 times
afterhumanperceptiontypeitsnameforwhichbeforevariable
Problem
In some programming languages type of variable goes before it's name.
In another - name goes first and then type.
Which version loads brain less and allow easier think about problem ?
In another - name goes first and then type.
Which version loads brain less and allow easier think about problem ?
Solution
I don't think there is any research (with good methodology) on this. The language I'd most expect to have actually thought about this and made an empirically-based decision is the Quorum programming language. It uses a "type before variable name" approach (though it does put the return type of a method declaration after the parameter list). However, what I believe is the primary source for the language design decisions, An Empirical Investigation into Programming Language Syntax (available via the first author's web site), does not mention this aspect or suggest that it was studied in the research reported on in that paper. There is other research by that group and research by others that was used to design Quorum, so it's possible it is covered in that other research. I haven't read it all. You can try contacting one of the creators of Quorum and asking them if they made that decision based on empirical research. If you do and you get a positive response, I would highly recommend self-answering this question with a reference to the research.
Context
StackExchange Computer Science Q#88699, answer score: 7
Revisions (0)
No revisions yet.