This may fall squarely in the “it doesn’t matter” camp, but I was touching up my IFComp 2019 entry and was wondering if one way is better than the other for disabling options you shouldn’t be able to set yet.
Very Vile Fairy File has an item called a Leet Learner with 4 several options, but I only listed the on/off states for 2.
volume options
book leet learner options
hahalfing is leetsetting.
nahnaffing is leetsetting.
helphowing is leetsetting.
welpwowing is leetsetting.
before leetsetting when player does not have the leet learner: say "You don't have the Leet Learner yet, so you can't set this option." instead;
volume options
this is the check-for-learner option: if player does not have the leet learner: say "You don't have the Leet Learner yet, so you can't set this option." instead;
check hahalfing: abide by the check-for-learner option;
check nahnaffing: abide by the check-for-learner option;
check helphowing: abide by the check-for-learner option;
check welpwowing: abide by the check-for-learner option;
The second piece of code has the advantage of not triggering a before/instead rule, which may save some time during testing or if the game gets too big. The first is more compact, but I’d like to avoid instead/before rules if possible. But it isn’t dogma.
Is either strictly better? Or is there a third way that avoids both “instead” and awkward code? Or am I overthinking a small thing here? (Even if I am, I hope newer programmers may find the ideas useful.)