Comment by blunte

5 years ago

One of my tasks as a young developer was to make a shell script faster. The systems engineers (who used this script to setup and configure large scale network management systems) were complaining that the "menu" took 60 seconds or more between selections.

Ok, sure, sounds easy. Then I opened the script... 9000 lines. After reading and understanding what it was supposed to do, I rewrote it in 1500 lines (still basic SunOS unix shell code), and with reasonable use of internal data structures for caching so only the first menu visit required a time hit. Beyond that, it was 1 second for menu selections. To say the system engineers were pleased would be an understatement.

My manager was pleased but also displeased, because he was the author of the 9000 line monstrosity.