<p>In some programming languages type of variable goes before it's name.<br>
In another - name goes first and then type.
For example if I declare string:<br>
<code>String s = "some string"</code><br>
Or<br>
<code>val s: String = "some string"</code><br>
Which version loads brain less and allow easier think about problem ?</p>

CC BY-SA 3.0
2018-02-27T22:36:31.273Z
I have no idea if this question is more appropriate for here or cs.stackexchange. Regardless, I'm pretty sure the answer is that we don't know. Heck, we just started to measure [if curly braces are a good idea](http://neverworkintheory.org/2014/01/29/stefik-siebert-syntax.html) (they aren't).
Seanny123
CC BY-SA 3.0
2018-02-28T13:34:56.833Z
I think this may also depend on the [regular] language [used to communicate in everyday life]. For example, English places its adjectives before the subject (type-object, e.g. 'wooden chair'), while in French its the reverse ('chaise en bois')
AliceD
CC BY-SA 3.0
2018-02-28T14:40:36.863Z
@AliceD But type isn't adjective, it's a noun that describes name. We say 'Lucky is a dog', i.e. <name> is a <type>, so type comes after name in English. Isn't it ?
R S
CC BY-SA 3.0
2018-02-28T19:33:32.650Z
Yes that makes sense. Anyway, my point really was if you've done some research yourself so to scope the question.
AliceD
CC BY-SA 3.0
2018-04-14T18:33:10.503Z
This is an interesting question, although I doubt it has been researched. If we follow the natural language analogy, then "s is a string variable" is the most natural expression, so formally something like "s: String [var]" but most programming languages don't look like that. I think Perl is the only language that tried to have "naturally sounding" versions of some language constructs, but not related to typing, as far as I remember. On the other hand you could read the fist construct as "[the] String s is ...". So I guess it's opinion based without a usability study.
got trolled too much this week
CC BY-SA 3.0
2018-04-14T18:47:54.837Z
You're more likely to get an answer (if this has been researched) on the PPIG mailing list http://www.ppig.org/about
got trolled too much this week
<cognitive-psychology><educational-psychology><reading><language-processing>
Which is easier for human perception: type of variable before or after its name?
R S
# Which is easier for human perception: type of variable before or after its name?

(Asked by: username_0 on 2018-02-27)

In some programming languages type of variable goes before it's name.  
In another - name goes first and then type.
For example if I declare string:  
`String s = "some string"`  
Or  
`val s: String = "some string"`  
Which version loads brain less and allow easier think about problem ?

**Tags:** cognitive-psychology, educational-psychology, reading, language-processing

> **Comments:**
> **username_1**: I have no idea if this question is more appropriate for here or cs.stackexchange. Regardless, I'm pretty sure the answer is that we don't know. Heck, we just started to measure [if curly braces are a good idea](http://neverworkintheory.org/2014/01/29/stefik-siebert-syntax.html) (they aren't).  
> **username_2**: I think this may also depend on the [regular] language [used to communicate in everyday life]. For example, English places its adjectives before the subject (type-object, e.g. 'wooden chair'), while in French its the reverse ('chaise en bois')  
> **username_0**: @username_2 But type isn't adjective, it's a noun that describes name. We say 'Lucky is a dog', i.e. <name> is a <type>, so type comes after name in English. Isn't it ?  
> **username_2**: Yes that makes sense. Anyway, my point really was if you've done some research yourself so to scope the question.  
> **username_3**: This is an interesting question, although I doubt it has been researched. If we follow the natural language analogy, then "s is a string variable" is the most natural expression, so formally something like "s: String [var]" but most programming languages don't look like that. I think Perl is the only language that tried to have "naturally sounding" versions of some language constructs, but not related to typing, as far as I remember. On the other hand you could read the fist construct as "[the] String s is ...". So I guess it's opinion based without a usability study.  
> **username_3**: You're more likely to get an answer (if this has been researched) on the PPIG mailing list http://www.ppig.org/about  

---

## 0 answers

