From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Junio C Hamano <junkio@cox.net>, git@vger.kernel.org
Subject: Re: [PATCH] diff-cache path restriction fix.
Date: Wed, 25 May 2005 11:06:16 +0200 [thread overview]
Message-ID: <20050525090616.GB27025@elte.hu> (raw)
In-Reply-To: <Pine.LNX.4.58.0505242002340.2307@ppc970.osdl.org>
* Linus Torvalds <torvalds@osdl.org> wrote:
> On Tue, 24 May 2005, Junio C Hamano wrote:
> >
> > LT> Also, what language do you actually speak?
> >
> > Japanese.
>
> It is possible it is cultural. I certainly find it harder to read the
> "unexpected" way.
i'm quite sure it's related to ambiguity. The main problem for the human
brain when reading code is ambiguity of expression - ambiguity triggers
'logic' areas of the brain, instead of the 'visual automation' portions
of the brain. 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.
The moment we fall out of automation (you go to the bathroom in the
morning but the toothpaste is empty, or you are in the shop and the
coffee area got moved to another place), we feel unease. Thinking during
normally routine activities means problems, it means distraction, it
meant larger reaction times in the jungle for millions of years, and
that's why the built-in unease. Thinking generates unease _especially_
if you dont expect it and dont want it - even if you happen to be Albert
Einstein or Linus Torvalds ;) [And it's way too easy to let the
autopilot drive all the time - there are people who stop thinking in
their childhood and autopilot through life.]
Coding styles are mostly there to reduce the syntactic ambiguities of
computer languages (and hence reducing parsing complexity), and thus to
make it easier for the human brain to parse them - and thus to give more
brain capacity for the real thinking.
the other interesting question is, why do most coders pick the 'x < 1'
variant? I'm quite sure that's due to most of us having learned coding
via operators. It's "x := 1" and "x /= 2", where the mirror image is not
valid - and we extend that expectation to ambiguous operators too. It's
the more complex entitity (the variable) that we think about first, and
then comes the less complex entity. But if someone has a strong math
background (Junio?) then the "1 < x < 5" syntax could be the natural
thing he got used to.
so as long as the actual expressions are used in an unambiguous way,
it's fine and it's part of the coding style and it's all a matter of
getting used to it. Junio's method is just as unambiguous. How quickly
you can adopt to another coding style is directly related to how
practiced you are at it, but it also depends on your fundamental
abstraction abilities. The overwhelming majority of coders dont "switch"
a coding style that easily, but e.g. people who maintain a large number
of packages or use lots of languages are very good at it. You have the
luxory to be able to read your own coding style all day so it's pretty
natural to feel unease if something else comes along :)
Ingo
next prev parent reply other threads:[~2005-05-25 9:05 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 [this message]
2005-05-25 17:07 ` Linus Torvalds
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050525090616.GB27025@elte.hu \
--to=mingo@elte.hu \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=torvalds@osdl.org \
/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.
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 NNTP newsgroup(s).