Discussion about this post

User's avatar
John Roshi's avatar

Hmmm, it makes sense from a certain, mathematical, perspective. Did you just make this up or is it based on some study of human perception? Is there evidence that when programmers examine a comparison that they imagine a number line? In my experience, what I look for in a comparison is two things: what is the variable I'm evaluating, and what is the value it is being compared to. Semantically I want to know what the variable is first. It is the core piece of meaningful information, what the comparison is setup to evaluate. When I see 'foo' I mentally envision what this quantity represents. Then when I read the value being compared to I have a frame of reference, I can fit the value into the range of allowed values for the variable. So I like foo > 0. For multiple conditions, I like foo > 0 and foo < 100 (but not foo<100 and foo > 0; so maybe your number line hypothesis works here: put the smaller value in the left-hand condition).

Expand full comment
1 more comment...

No posts