| « Sausage Mystery Ingredient | Equals » |
Different tasks call for different conventions. At least, that’s the excuse some people use for switching between 0-based and 1-based array indexes. That still doesn’t explain why Phillip’s co-worker did this.
var panelIndexes = { "1" : 0, "2": 1, "3": 3, "4": 4, "5": 5, "6": 6, "7": 7, "8": 8, "10": 9, "11" : 2, "12" : 10 //Don't ask }; /* snip */ var activePanel = panels[panelIndexes[i]];
It says, “Don’t ask,” and I think I’ll take that advice.
|
What happens in ActionScript... stays in ActionScript.
|
|
That looks something like that "dependent" coding in an insurance system I worked on one time (best recollection):
01 - spouse 02 - first child 11 - first adult dependent 12 - second child 21 - second adult dependent 22 - third child 23 - fourth child 24 - fifth child 98 - any additional children I think this is also a, "Don't ask." But it's interesting to make a system count 02, 12, 22, 23, 24, 98, 98, 98 for children because the requirement was that these could not be used out of order. So if the user just put in a 12 for a single child, it would get rejected because there was no 02 coding. So we either had to edit for that or else compute the numbering; moreover, the rows had to be re-coded if a child was removed. |
| « Sausage Mystery Ingredient | Equals » |