Re: [PATCH] diff-cache path restriction fix.
On Wed, 25 May 2005, Ingo Molnar wrote:
>
> Like it or not, most of the code reading we do is all automatism, if we
> had to _think_ about the visual structure of the code we'd be much less
> effective.
Absolutely. And you _should_ like it, because it means that you can concentrate on the big problems.
I suspect I react more strongly to some coding style issues than most, exactly because I've been so involved with just one language and one style for so long that I've got more of an auto-pilot than most: normally my brain just coasts past 99% of all code, without having to be very conscious about it at all, exactly because the patterns have become so ingrained.
In contrast, somebody who works on different projects and with many different languages is likely to have many more patterns, but they are probably less deep, so breaking them isn't as disturbing.
> But if someone has a strong math background (Junio?) then
> the "1 < x < 5" syntax could be the natural thing he got used to.
Actually, even in math (in fact, very _much_ in math) I'd say that people always aim to put the variable on the left side, and you very much tend to try to aim for canonical formats (sort by exponent and variable name). You'd never see anybody write "y + x = 5" or "x + x^2", because there's a canonical format for it, and people use it.
The "1 < x < 5" syntax is very much the odd man out, and that order for the first part is _only_ used for two-sided comparisons afaik. Math people (at least all math texts I've ever seen, and I had math as a strong minor although admittedly that is some time ago) will invariably write the variable on the left side if there's just one comparison.
In fact, in math, I'd expect a person to often tend to take the canonical format even further, and sort _everything_ to the left side, and aim to leave the right side totally empty (ie "0"), exactly because that makes certain combinations much easier. So it wouldn't surprise me at all to see a math person change "x > 1" into "x - 1 > 0", but it _would_ surprise me to see a math person change it into "1 < x" unless it is to combine it with _another_ comparison with "x".
Linus