Christian Faulhammer wrote:
> In my eyes, defining all local variables at the beginning of a function
> makes it easier to read.
Sorry, Fauli, i totally missed your mail as it was only addressed to
gentoo-dev, while I've been intently watching gentoo-java...
java-pkg-simple_src_compile() was designed in a modular fashion, with
blocks for compile, javadoc and package which are pretty much
independent from one another. That's the reason why every one of these
blocks has its own local variables, instead of a single set of locals
for the whole function.
Originally I wrote them as independent functions, and they might well be
turned into such independent functions by adding a few function headers
and braces. So if ever the need arises, that's what I'd do. Splitting
locals would increase the footprint of such a change.
From my #gentoo-java log from 2009-01-03:
(11:24:36 UTC) MvG:
java-pkg-simple_src_compile has five clear parts; would it make sense to
place these in separate functions? This would allow more flexibility for
ebuilds that want to use some but not all of these.
(11:26:20 UTC) ali_bush:
MvG: up to you, if they are clear, they could alway be separated out later
To sum things up: yes, I could change the local declarations, but I'd
rather keep things as they are, unless you object more vehemently.
Martin von Gagern (MvG)