Re: Update script for 329841 finished. Comments?
- From: "Thomas Van Machelen" <thomas vanmachelen gmail com>
- To: bengt thuree com
- Cc: f-spot-list gnome org
- Subject: Re: Update script for 329841 finished. Comments?
- Date: Mon, 6 Mar 2006 12:18:31 +0100
HI Bengt
2006/3/6, Bengt Thuree <bengt thuree com>:
> > Though it's not functional programming, why not use continue instead of
> > huge if's (making most of the code drop 2 indents):
> Have not changed this. Thought it was well commented, and easy to
> follow. If there is a strong request to change and use "continue"
> instead I will look into it.
It's not that the code isn't clear enough, it's just a matter of
reducing code nesting and making code look easier on the eye.
Let's quote from the f-spot hacking document:
<quote>
Since we are using 8-space tabs, you might want to consider the Linus
Torvalds trick to reduce code nesting. Many times in a loop, you will
find yourself doing a test, and if the test is true, you will
nest. Many times this can be changed. Example:
for (i = 0; i < 10; i++) {
if (Something (i)) {
DoMore ();
}
}
This take precious space, instead write it like this:
for (i = 0; i < 10; i++) {
if (! Something (i))
continue;
DoMore ();
}
</quote>
Regards,
Thomas
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]