git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Junio C Hamano <junkio@cox.net>, git@vger.kernel.org
Subject: Re: [PATCH] diff-cache path restriction fix.
Date: Wed, 25 May 2005 10:07:21 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0505250948340.2307@ppc970.osdl.org> (raw)
In-Reply-To: <20050525090616.GB27025@elte.hu>



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

  reply	other threads:[~2005-05-25 17:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-25  0:47 [PATCH] diff-cache path restriction fix Junio C Hamano
2005-05-25  1:00 ` Linus Torvalds
2005-05-25  1:05   ` Junio C Hamano
2005-05-25  1:24     ` Linus Torvalds
2005-05-25  1:49       ` Junio C Hamano
2005-05-25  2:16         ` Russ Allbery
2005-05-25  2:33           ` Junio C Hamano
2005-05-25  3:04         ` Linus Torvalds
2005-05-25  3:22           ` Junio C Hamano
2005-05-25  9:06           ` Ingo Molnar
2005-05-25 17:07             ` Linus Torvalds [this message]
2005-05-25 19:14             ` Junio C Hamano
2005-05-25 19:17               ` Thomas Glanzmann
2005-05-25 20:31             ` Matthias Urlichs
2005-05-28  7:55         ` [OT] if (4 < number_of_children) you're in trouble Junio C Hamano
2005-05-25  8:31       ` [PATCH] diff-cache path restriction fix Ingo Molnar
2005-05-25 16:02     ` Florian Weimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.58.0505250948340.2307@ppc970.osdl.org \
    --to=torvalds@osdl.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).