> >On another note, while looking for -style I looked at GUI.xs. > > > >Being loath to comment: > >1. GUI.xs uses a conditional ladder to perform a search. > >2. On success, GUI.xs executes code in the conditional block. > > > >It occurs to me that there are two operations that need to be performed; 1) > >search, 2) some action based on the search. The current approach is the > >same ...
> However, there is always functions that aren't worth optimising > because either they are used during initialisation or they are called > infrequently during runtime. I don't know if this is the case in what you've > highlighted. Yes, in principle the best code should be always used, but > would it be worth your time "fixing" this area when it's not broken? I would > say if there is little benefit in terms of performance, your talents are > better used elsewhere. The primary issue is maintenance and ease of understanding. In this case, speed is increased and space is decreased. The rationale is that since the basic code doesn't change (search and decision) future changes are limited to placement of data within a data structure. Maintaining the current approach requires the generation of code, for the search, and the placement of the code within a conditional ladder, and the generation of code for the action to be performed or the reuse of existing code. Software must be tested and revalidated for new code, search or action. What the proposed change does is to remove design decisions for the search phase and at the same time remove any requirement for retesting the search, and to leave intact decisions and testing related to the action. If an action is reused, it presumably need not go through any rigorous testing for a reuse. If a new action is developed, it must be tested. In a minimalistic sense, all that has been done is to convert an increase in code to an increase in a data structure and to reuse code. Of more global scope, with the existing mechanization as the number of entries grows, the amount of code grows. Even though the code is well organized and easy to understand, at some stage it becomes almost intractable to maintain because of its size. My motivation is to reduce maintainence, increase clarity, and if possible, increase the speed of execution and decrease the memory footprint. art