I Grumble About Code Yet Again
Sep. 24th, 2001 02:07 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
This repeated use of only the first thing returned by an iterator is evidence of poor design.
If there can only be one, don't use an iterator.
If there could be more than one, do your thing for each of them.
If there can only be one, don't use an iterator.
If there could be more than one, do your thing for each of them.
no subject
Date: 2001-09-24 12:07 pm (UTC)I'm not saying it's the case here, but I can't say I would be terribly surprised if the first value contained, say, meta-data about the others.
no subject
Date: 2001-09-24 12:33 pm (UTC)(In the cases I'm grumbling about, we're talking about inputs and outputs on nodes in an analysis tree. Most nodes do have a single input site, and non-filter nodes have a single output site, but it's icky to assume that things are so all over the place. Or rather, it's icky to have started with a more general premise and then to be sabotaging that generality by assuming that a special case holds.)