git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Add git-annotate, a tool for assigning blame.

From
RARyan Anderson <ryan@michonline.com>
Date
Feb 28, 2006, 08:47 UTC
Message-ID
<20060228084737.GA13537@mythryan2.michonline.com>
In-Reply-To
<20060228082736.GA4593@c165.ib.student.liu.se>
On Tue, Feb 28, 2006 at 09:27:36AM +0100, Fredrik Kuivinen wrote:
Show 15 quoted lines
> On Mon, Feb 20, 2006 at 04:01:56PM -0800, Junio C Hamano wrote:
> > Fredrik Kuivinen <freku045@student.liu.se> writes:
> > 
> > > I have also been working on a blame program.
> 
> ...
> 
> > BTW, these days I always compile things with 
> > 
> > 	-Wall -Wdeclaration-after-statement
> > 
> > which caught quite a many.
> 
> Just out of curiosity, why do you prefer declarations before
> statements?

I won't speak for Junio, but the explanations I've heard in the past are basically:

1) It keeps all declarations in one spot.
2) If your function is complicated enough to not need a variable until
fairly far into the function, it probably should be two (or more) functions.

Basically, I think that there's not wrong with doing it that way, per se, just that it's sometimes a symptom of other problems, so fi you look for the symptom, the problem sometimes is more obvious.

-- 
Ryan Anderson
  sometimes Pug Majere
Previous: Junio C HamanoNext: Andreas Ericsson
Message 7 of 13 in “Add git-annotate, a tool for assigning blame.”
  1. Add git-annotate, a tool for assigning blame.Ryan Anderson, Feb 20, 2006
  2. Junio C HamanoFeb 20, 2006
  3. Fredrik KuivinenFeb 20, 2006
  4. Junio C HamanoFeb 21, 2006
  5. Fredrik KuivinenFeb 28, 2006
  6. Junio C HamanoFeb 28, 2006
  7. Ryan AndersonFeb 28, 2006
  8. Andreas EricssonFeb 28, 2006
  9. Ryan AndersonFeb 23, 2006
  10. Fredrik KuivinenFeb 23, 2006
  11. Johannes SchindelinFeb 24, 2006
  12. Junio C HamanoFeb 24, 2006
  13. Johannes SchindelinFeb 24, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.