So much of my code ends up being stuff like this:
List powerups = PowerupFeature.getPowerups();
ArrayList available = new ArrayList(powerups.size());
// We just want the available powerups
for (int i = 0; i < powerups.size(); i ++) {
ShopItem pf = (ShopItem) powerups.get(i);
if (pf.isAvailable() || DEBUG) {
available.add(pf);
}
}
buildShopItems(available);
when what would just look so much nicer is SQL:
buildShopItems
(
select
pf
from
PowerupFeature.getPowerups() pf
where
pf.isAvailable() || DEBUG
);
I believe something like this is in C# (LINQ isn’t it?)
Set operations are just such a fundamental way of dealing with data I wonder why they haven’t been integrated into proper languages much sooner.
Cas